summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowmacosx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow/llwindowmacosx.cpp')
-rw-r--r--indra/llwindow/llwindowmacosx.cpp48
1 files changed, 47 insertions, 1 deletions
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index ad97bc45fc..924acaf148 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -1122,7 +1122,33 @@ BOOL LLWindowMacOSX::getMaximized()
BOOL LLWindowMacOSX::maximize()
{
- // TODO
+ if (mWindow)
+ {
+ // *HACK: Because Mac OSX doesn't have a concept of a "maximized" window, we just
+ // stretch it out to the visible screen size.
+ Rect win_rect;
+
+ int visible_x;
+ int visible_y;
+ int visible_width;
+ int visible_height;
+ int screen_width;
+ int screen_height;
+
+ getScreenSize(&screen_width, &screen_height);
+ getVisibleScreen(&visible_x, &visible_y, &visible_width, &visible_height);
+
+ int mac_os_menu_bar_height = screen_height - (visible_height + visible_y);
+ ::SetRect(&win_rect,
+ visible_x,
+ mac_os_menu_bar_height,
+ visible_width + visible_x,
+ visible_height + mac_os_menu_bar_height);
+
+ ::SetWindowBounds(mWindow, kWindowStructureRgn, &win_rect);
+
+ return TRUE;
+ }
return FALSE;
}
@@ -3464,6 +3490,26 @@ MASK LLWindowMacOSX::modifiersToMask(SInt16 modifiers)
return mask;
}
+// static
+S32 LLWindowMacOSX::getDisplayWidth()
+{
+ S32 width = 1024;
+ // Need to invoke cocoa before use getScreenSize()
+ setupCocoa();
+ getScreenSize(&width, NULL);
+ return width;
+}
+
+// static
+S32 LLWindowMacOSX::getDisplayHeight()
+{
+ S32 height = 768;
+ // Need to invoke cocoa before use getScreenSize()
+ setupCocoa();
+ getScreenSize(NULL, &height);
+ return height;
+}
+
#if LL_OS_DRAGDROP_ENABLED
OSErr LLWindowMacOSX::dragTrackingHandler(DragTrackingMessage message, WindowRef theWindow,