summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowmacosx.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-03-09 13:19:46 +0000
committerTofu Linden <tofu.linden@lindenlab.com>2010-03-09 13:19:46 +0000
commitd0d1534e34a544a2a2acc9993421f587bb4f6ede (patch)
tree99eb3d9b83bcbcaaedf3413aa2eecbf3cf329fbe /indra/llwindow/llwindowmacosx.cpp
parentdf50590145a835531a9539a96e8349f910161f53 (diff)
parent7b029036339ae1770307ff33ccd5d540e2618748 (diff)
merge from viewer-2-0
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,