summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llopenglview-objc.mm17
-rwxr-xr-xindra/llwindow/llwindowheadless.cpp1
-rwxr-xr-xindra/llwindow/llwindowheadless.h3
-rwxr-xr-xindra/llwindow/llwindowmacosx.cpp49
-rwxr-xr-xindra/llwindow/llwindowmacosx.h6
-rwxr-xr-xindra/llwindow/llwindowmesaheadless.h1
-rwxr-xr-xindra/llwindow/llwindowsdl.h1
-rwxr-xr-xindra/llwindow/llwindowwin32.h1
8 files changed, 47 insertions, 32 deletions
diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm
index 24b8406098..1c9160a42d 100644
--- a/indra/llwindow/llopenglview-objc.mm
+++ b/indra/llwindow/llopenglview-objc.mm
@@ -104,20 +104,20 @@ attributedStringInfo getSegments(NSAttributedString *str)
- (unsigned long)getVramSize
{
CGLRendererInfoObj info = 0;
- GLint vram_mbytes = 0;
+ GLint vram_megabytes = 0;
int num_renderers = 0;
CGLError the_err = CGLQueryRendererInfo (CGDisplayIDToOpenGLDisplayMask(kCGDirectMainDisplay), &info, &num_renderers);
if(0 == the_err)
{
- CGLDescribeRenderer (info, 0, kCGLRPTextureMemoryMegabytes, &vram_mbytes);
+ CGLDescribeRenderer (info, 0, kCGLRPTextureMemoryMegabytes, &vram_megabytes);
CGLDestroyRendererInfo (info);
}
else
{
- vram_mbytes = 256;
+ vram_megabytes = 256;
}
- return (unsigned long)vram_mbytes;
+ return (unsigned long)vram_megabytes; // return value is in megabytes.
}
- (void)viewDidMoveToWindow
@@ -133,6 +133,10 @@ attributedStringInfo getSegments(NSAttributedString *str)
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification
object:[self window]];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification
+ object:[self window]];
}
- (void)setOldResize:(bool)oldresize
@@ -159,6 +163,11 @@ attributedStringInfo getSegments(NSAttributedString *str)
callWindowUnhide();
}
+- (void)windowDidBecomeKey:(NSNotification *)notification;
+{
+ mModifiers = [NSEvent modifierFlags];
+}
+
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
diff --git a/indra/llwindow/llwindowheadless.cpp b/indra/llwindow/llwindowheadless.cpp
index e6e6bc67ff..70f473281b 100755
--- a/indra/llwindow/llwindowheadless.cpp
+++ b/indra/llwindow/llwindowheadless.cpp
@@ -51,4 +51,3 @@ LLWindowHeadless::~LLWindowHeadless()
void LLWindowHeadless::swapBuffers()
{
}
-
diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h
index 1f767f4c97..c692666df1 100755
--- a/indra/llwindow/llwindowheadless.h
+++ b/indra/llwindow/llwindowheadless.h
@@ -75,7 +75,8 @@ public:
/*virtual*/ void delayInputProcessing() {};
/*virtual*/ void swapBuffers();
- // handy coordinate space conversion routines
+
+ // handy coordinate space conversion routines
/*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) { return FALSE; };
/*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to) { return FALSE; };
/*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordGL *to) { return FALSE; };
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index d7aa47f378..15e054fb5d 100755
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -44,15 +44,9 @@
extern BOOL gDebugWindowProc;
-// culled from winuser.h
-//const S32 WHEEL_DELTA = 120; /* Value for rolling one detent */
-// On the Mac, the scroll wheel reports a delta of 1 for each detent.
-// There's also acceleration for faster scrolling, based on a slider in the system preferences.
-const S32 WHEEL_DELTA = 1; /* Value for rolling one detent */
const S32 BITS_PER_PIXEL = 32;
const S32 MAX_NUM_RESOLUTIONS = 32;
-
//
// LLWindowMacOSX
//
@@ -244,8 +238,8 @@ void callRightMouseDown(float *pos, MASK mask)
}
LLCoordGL outCoords;
- outCoords.mX = llround(pos[0]);
- outCoords.mY = llround(pos[1]);
+ outCoords.mX = ll_round(pos[0]);
+ outCoords.mY = ll_round(pos[1]);
gWindowImplementation->getCallbacks()->handleRightMouseDown(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE));
}
@@ -257,8 +251,8 @@ void callRightMouseUp(float *pos, MASK mask)
}
LLCoordGL outCoords;
- outCoords.mX = llround(pos[0]);
- outCoords.mY = llround(pos[1]);
+ outCoords.mX = ll_round(pos[0]);
+ outCoords.mY = ll_round(pos[1]);
gWindowImplementation->getCallbacks()->handleRightMouseUp(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE));
}
@@ -270,8 +264,8 @@ void callLeftMouseDown(float *pos, MASK mask)
}
LLCoordGL outCoords;
- outCoords.mX = llround(pos[0]);
- outCoords.mY = llround(pos[1]);
+ outCoords.mX = ll_round(pos[0]);
+ outCoords.mY = ll_round(pos[1]);
gWindowImplementation->getCallbacks()->handleMouseDown(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE));
}
@@ -283,8 +277,8 @@ void callLeftMouseUp(float *pos, MASK mask)
}
LLCoordGL outCoords;
- outCoords.mX = llround(pos[0]);
- outCoords.mY = llround(pos[1]);
+ outCoords.mX = ll_round(pos[0]);
+ outCoords.mY = ll_round(pos[1]);
gWindowImplementation->getCallbacks()->handleMouseUp(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE));
}
@@ -297,8 +291,8 @@ void callDoubleClick(float *pos, MASK mask)
}
LLCoordGL outCoords;
- outCoords.mX = llround(pos[0]);
- outCoords.mY = llround(pos[1]);
+ outCoords.mX = ll_round(pos[0]);
+ outCoords.mY = ll_round(pos[1]);
gWindowImplementation->getCallbacks()->handleDoubleClick(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE));
}
@@ -313,8 +307,8 @@ void callResize(unsigned int width, unsigned int height)
void callMouseMoved(float *pos, MASK mask)
{
LLCoordGL outCoords;
- outCoords.mX = llround(pos[0]);
- outCoords.mY = llround(pos[1]);
+ outCoords.mX = ll_round(pos[0]);
+ outCoords.mY = ll_round(pos[1]);
float deltas[2];
gWindowImplementation->getMouseDeltas(deltas);
outCoords.mX += deltas[0];
@@ -376,8 +370,8 @@ void callDeltaUpdate(float *delta, MASK mask)
void callMiddleMouseDown(float *pos, MASK mask)
{
LLCoordGL outCoords;
- outCoords.mX = llround(pos[0]);
- outCoords.mY = llround(pos[1]);
+ outCoords.mX = ll_round(pos[0]);
+ outCoords.mY = ll_round(pos[1]);
float deltas[2];
gWindowImplementation->getMouseDeltas(deltas);
outCoords.mX += deltas[0];
@@ -388,8 +382,8 @@ void callMiddleMouseDown(float *pos, MASK mask)
void callMiddleMouseUp(float *pos, MASK mask)
{
LLCoordGL outCoords;
- outCoords.mX = llround(pos[0]);
- outCoords.mY = llround(pos[1]);
+ outCoords.mX = ll_round(pos[0]);
+ outCoords.mY = ll_round(pos[1]);
float deltas[2];
gWindowImplementation->getMouseDeltas(deltas);
outCoords.mX += deltas[0];
@@ -525,8 +519,8 @@ void LLWindowMacOSX::updateMouseDeltas(float* deltas)
{
if (mCursorDecoupled)
{
- mCursorLastEventDeltaX = llround(deltas[0]);
- mCursorLastEventDeltaY = llround(-deltas[1]);
+ mCursorLastEventDeltaX = ll_round(deltas[0]);
+ mCursorLastEventDeltaY = ll_round(-deltas[1]);
if (mCursorIgnoreNextDelta)
{
@@ -904,6 +898,11 @@ void LLWindowMacOSX::swapBuffers()
CGLFlushDrawable(mContext);
}
+void LLWindowMacOSX::restoreGLContext()
+{
+ CGLSetCurrentContext(mContext);
+}
+
F32 LLWindowMacOSX::getGamma()
{
F32 result = 2.2; // Default to something sane
@@ -1158,6 +1157,8 @@ void LLWindowMacOSX::beforeDialog()
void LLWindowMacOSX::afterDialog()
{
+ //For fix problem with Core Flow view on OSX
+ restoreGLContext();
}
diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h
index 825fd05c5f..9e9bd8ae39 100755
--- a/indra/llwindow/llwindowmacosx.h
+++ b/indra/llwindow/llwindowmacosx.h
@@ -87,7 +87,7 @@ public:
/*virtual*/ void gatherInput();
/*virtual*/ void delayInputProcessing() {};
/*virtual*/ void swapBuffers();
-
+
// handy coordinate space conversion routines
/*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to);
/*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to);
@@ -155,7 +155,9 @@ protected:
//Satisfy MAINT-3135 and MAINT-3288 with a flag.
/*virtual */ void setOldResize(bool oldresize) {setResizeMode(oldresize, mGLView); }
-
+
+private:
+ void restoreGLContext();
protected:
//
diff --git a/indra/llwindow/llwindowmesaheadless.h b/indra/llwindow/llwindowmesaheadless.h
index 8f70aee4f6..00e42240e6 100755
--- a/indra/llwindow/llwindowmesaheadless.h
+++ b/indra/llwindow/llwindowmesaheadless.h
@@ -77,6 +77,7 @@ public:
/*virtual*/ void gatherInput() {};
/*virtual*/ void delayInputProcessing() {};
/*virtual*/ void swapBuffers();
+ /*virtual*/ void restoreGLContext() {};
// handy coordinate space conversion routines
/*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) { return FALSE; };
diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h
index c5ce892a04..7193e6f45a 100755
--- a/indra/llwindow/llwindowsdl.h
+++ b/indra/llwindow/llwindowsdl.h
@@ -97,6 +97,7 @@ public:
/*virtual*/ void processMiscNativeEvents();
/*virtual*/ void gatherInput();
/*virtual*/ void swapBuffers();
+ /*virtual*/ void restoreGLContext() {};
/*virtual*/ void delayInputProcessing() { };
diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h
index 169d264808..2ca8d48fc7 100755
--- a/indra/llwindow/llwindowwin32.h
+++ b/indra/llwindow/llwindowwin32.h
@@ -83,6 +83,7 @@ public:
/*virtual*/ void gatherInput();
/*virtual*/ void delayInputProcessing();
/*virtual*/ void swapBuffers();
+ /*virtual*/ void restoreGLContext() {};
// handy coordinate space conversion routines
/*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to);