summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llwindow/llopenglview-objc.mm8
-rw-r--r--indra/llwindow/llwindowcallbacks.cpp5
-rw-r--r--indra/llwindow/llwindowcallbacks.h1
-rw-r--r--indra/llwindow/llwindowmacosx-objc.h1
-rw-r--r--indra/llwindow/llwindowmacosx.cpp8
-rw-r--r--indra/newview/llviewerwindow.cpp8
-rw-r--r--indra/newview/llviewerwindow.h1
7 files changed, 32 insertions, 0 deletions
diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm
index de123d80d5..ee05fd5cc9 100644
--- a/indra/llwindow/llopenglview-objc.mm
+++ b/indra/llwindow/llopenglview-objc.mm
@@ -167,6 +167,9 @@ attributedStringInfo getSegments(NSAttributedString *str)
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification
object:[self window]];
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(windowDidChangeScreen:) name:NSWindowDidChangeScreenNotification
+ object:[self window]];
NSRect wnd_rect = [[self window] frame];
@@ -206,6 +209,11 @@ attributedStringInfo getSegments(NSAttributedString *str)
mModifiers = [NSEvent modifierFlags];
}
+-(void)windowDidChangeScreen:(NSNotification *)notification;
+{
+ callWindowDidChangeScreen();
+}
+
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
diff --git a/indra/llwindow/llwindowcallbacks.cpp b/indra/llwindow/llwindowcallbacks.cpp
index 7e90ade423..94c725fc7e 100644
--- a/indra/llwindow/llwindowcallbacks.cpp
+++ b/indra/llwindow/llwindowcallbacks.cpp
@@ -180,6 +180,11 @@ BOOL LLWindowCallbacks::handleDPIChanged(LLWindow *window, F32 ui_scale_factor,
return FALSE;
}
+BOOL LLWindowCallbacks::handleWindowDidChangeScreen(LLWindow *window)
+{
+ return FALSE;
+}
+
void LLWindowCallbacks::handlePingWatchdog(LLWindow *window, const char * msg)
{
diff --git a/indra/llwindow/llwindowcallbacks.h b/indra/llwindow/llwindowcallbacks.h
index 47d5a18858..4d753024fe 100644
--- a/indra/llwindow/llwindowcallbacks.h
+++ b/indra/llwindow/llwindowcallbacks.h
@@ -66,6 +66,7 @@ public:
virtual BOOL handleTimerEvent(LLWindow *window);
virtual BOOL handleDeviceChange(LLWindow *window);
virtual BOOL handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height);
+ virtual BOOL handleWindowDidChangeScreen(LLWindow *window);
enum DragNDropAction {
DNDA_START_TRACKING = 0,// Start tracking an incoming drag
diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h
index ef5f803718..743089be6b 100644
--- a/indra/llwindow/llwindowmacosx-objc.h
+++ b/indra/llwindow/llwindowmacosx-objc.h
@@ -147,6 +147,7 @@ void callWindowFocus();
void callWindowUnfocus();
void callWindowHide();
void callWindowUnhide();
+void callWindowDidChangeScreen();
void callDeltaUpdate(float *delta, unsigned int mask);
void callMiddleMouseDown(float *pos, unsigned int mask);
void callMiddleMouseUp(float *pos, unsigned int mask);
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index b02b77ffbd..376b8610b5 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -400,6 +400,14 @@ void callWindowUnhide()
}
}
+void callWindowDidChangeScreen()
+{
+ if ( gWindowImplementation && gWindowImplementation->getCallbacks() )
+ {
+ gWindowImplementation->getCallbacks()->handleWindowDidChangeScreen(gWindowImplementation);
+ }
+}
+
void callDeltaUpdate(float *delta, MASK mask)
{
gWindowImplementation->updateMouseDeltas(delta);
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 024d965c6d..0a8076173e 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1607,6 +1607,14 @@ BOOL LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32
}
}
+BOOL LLViewerWindow::handleWindowDidChangeScreen(LLWindow *window)
+{
+ LLCoordScreen window_rect;
+ mWindow->getSize(&window_rect);
+ reshape(window_rect.mX, window_rect.mY);
+ return TRUE;
+}
+
void LLViewerWindow::handlePingWatchdog(LLWindow *window, const char * msg)
{
LLAppViewer::instance()->pingMainloopTimeout(msg);
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index d8d420e6be..83ca18f85d 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -212,6 +212,7 @@ public:
/*virtual*/ BOOL handleTimerEvent(LLWindow *window);
/*virtual*/ BOOL handleDeviceChange(LLWindow *window);
/*virtual*/ BOOL handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height);
+ /*virtual*/ BOOL handleWindowDidChangeScreen(LLWindow *window);
/*virtual*/ void handlePingWatchdog(LLWindow *window, const char * msg);
/*virtual*/ void handlePauseWatchdog(LLWindow *window);