diff options
author | Logan Dethrow <log@lindenlab.com> | 2011-11-18 10:45:40 -0500 |
---|---|---|
committer | Logan Dethrow <log@lindenlab.com> | 2011-11-18 10:45:40 -0500 |
commit | 3819c3b049abb0771c7129c0a11a8fcd0725f9fd (patch) | |
tree | f0bb1432b1ae475c7d844f278b668e1d76193e96 /indra/llwindow | |
parent | 620b63a31667d93d9186217eb355d05e71ff245c (diff) | |
parent | 4bcdcd02fb7e83a2754084f2fb599b56ea6c8743 (diff) |
Merge
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/llwindowmacosx.cpp | 4 | ||||
-rw-r--r-- | indra/llwindow/llwindowsdl.cpp | 13 | ||||
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 16 |
3 files changed, 27 insertions, 6 deletions
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 4dd11541b9..8057506736 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -2545,8 +2545,8 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e { // This is where we would constrain move/resize to a particular screen - const S32 MIN_WIDTH = 320; - const S32 MIN_HEIGHT = 240; + const S32 MIN_WIDTH = 1024; + const S32 MIN_HEIGHT = 768; Rect currentBounds; Rect previousBounds; diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index e41aa9820f..da2222ad51 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -63,6 +63,9 @@ extern BOOL gDebugWindowProc; const S32 MAX_NUM_RESOLUTIONS = 200; +const S32 MIN_WINDOW_WIDTH = 1024; +const S32 MIN_WINDOW_HEIGHT = 768; + // static variable for ATI mouse cursor crash work-around: static bool ATIbug = false; @@ -1843,11 +1846,15 @@ void LLWindowSDL::gatherInput() break; case SDL_VIDEORESIZE: // *FIX: handle this? + { llinfos << "Handling a resize event: " << event.resize.w << "x" << event.resize.h << llendl; + S32 width = llmax(event.resize.w, MIN_WINDOW_WIDTH); + S32 height = llmax(event.resize.h, MIN_WINDOW_HEIGHT); + // *FIX: I'm not sure this is necessary! - mWindow = SDL_SetVideoMode(event.resize.w, event.resize.h, 32, mSDLFlags); + mWindow = SDL_SetVideoMode(width, height, 32, mSDLFlags); if (!mWindow) { // *FIX: More informative dialog? @@ -1861,9 +1868,9 @@ void LLWindowSDL::gatherInput() break; } - mCallbacks->handleResize(this, event.resize.w, event.resize.h ); + mCallbacks->handleResize(this, width, height); break; - + } case SDL_ACTIVEEVENT: if (event.active.state & SDL_APPINPUTFOCUS) { diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 121c7880df..a84bd5fb08 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -1031,6 +1031,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO mhInstance, NULL); + LL_INFOS("Window") << "window is created." << llendl ; + //----------------------------------------------------------------------- // Create GL drawing context //----------------------------------------------------------------------- @@ -1120,6 +1122,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO return FALSE; } + LL_INFOS("Window") << "Drawing context is created." << llendl ; + gGLManager.initWGL(); if (wglChoosePixelFormatARB) @@ -1256,7 +1260,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO LL_INFOS("Window") << "Choosing pixel formats: " << num_formats << " pixel formats returned" << LL_ENDL; } - + LL_INFOS("Window") << "pixel formats done." << llendl ; S32 swap_method = 0; S32 cur_format = num_formats-1; @@ -1306,6 +1310,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO mhInstance, NULL); + LL_INFOS("Window") << "recreate window done." << llendl ; + if (!(mhDC = GetDC(mWindowHandle))) { close(); @@ -2354,6 +2360,14 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ return 0; } + case WM_GETMINMAXINFO: + { + LPMINMAXINFO min_max = (LPMINMAXINFO)l_param; + min_max->ptMinTrackSize.x = 1024; + min_max->ptMinTrackSize.y = 768; + return 0; + } + case WM_SIZE: { window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_SIZE"); |