diff options
Diffstat (limited to 'indra/llwindow/llwindowwin32.cpp')
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 49 |
1 files changed, 31 insertions, 18 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 0b3936f8a5..7783505c27 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -714,6 +714,7 @@ LLWindowWin32::~LLWindowWin32() void LLWindowWin32::show() { + LL_DEBUGS("Window") << "Setting window to show" << LL_ENDL; ShowWindow(mWindowHandle, SW_SHOW); SetForegroundWindow(mWindowHandle); SetFocus(mWindowHandle); @@ -1126,6 +1127,12 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO mPostQuit = FALSE; // create window + LL_DEBUGS("Window") << "Creating window with X: " << window_rect.left + << " Y: " << window_rect.top + << " Width: " << (window_rect.right - window_rect.left) + << " Height: " << (window_rect.bottom - window_rect.top) + << " Fullscreen: " << mFullscreen + << LL_ENDL; DestroyWindow(mWindowHandle); mWindowHandle = CreateWindowEx(dw_ex_style, mWindowClassName, @@ -1941,6 +1948,8 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr( h_wnd, GWLP_USERDATA ); + bool debug_window_proc = gDebugWindowProc || debugLoggingEnabled("Window"); + if (NULL != window_imp) { @@ -1983,9 +1992,9 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ case WM_DEVICECHANGE: window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_DEVICECHANGE"); - if (gDebugWindowProc) + if (debug_window_proc) { - LL_INFOS() << " WM_DEVICECHANGE: wParam=" << w_param + LL_INFOS("Window") << " WM_DEVICECHANGE: wParam=" << w_param << "; lParam=" << l_param << LL_ENDL; } if (w_param == DBT_DEVNODES_CHANGED || w_param == DBT_DEVICEARRIVAL) @@ -2041,7 +2050,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ BOOL activating = (BOOL) w_param; BOOL minimized = window_imp->getMinimized(); - if (gDebugWindowProc) + if (debug_window_proc) { LL_INFOS("Window") << "WINDOWPROC ActivateApp " << " activating " << S32(activating) @@ -2092,7 +2101,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ // JC - I'm not sure why, but if we don't report that we handled the // WM_ACTIVATE message, the WM_ACTIVATEAPP messages don't work // properly when we run fullscreen. - if (gDebugWindowProc) + if (debug_window_proc) { LL_INFOS("Window") << "WINDOWPROC Activate " << " activating " << S32(activating) @@ -2164,7 +2173,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_KEYDOWN"); { - if (gDebugWindowProc) + if (debug_window_proc) { LL_INFOS("Window") << "Debug WindowProc WM_KEYDOWN " << " key " << S32(w_param) @@ -2190,7 +2199,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_KEYUP"); LL_RECORD_BLOCK_TIME(FTM_KEYHANDLER); - if (gDebugWindowProc) + if (debug_window_proc) { LL_INFOS("Window") << "Debug WindowProc WM_KEYUP " << " key " << S32(w_param) @@ -2206,9 +2215,9 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ } case WM_IME_SETCONTEXT: window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_SETCONTEXT"); - if (gDebugWindowProc) + if (debug_window_proc) { - LL_INFOS() << "WM_IME_SETCONTEXT" << LL_ENDL; + LL_INFOS("Window") << "WM_IME_SETCONTEXT" << LL_ENDL; } if (LLWinImm::isAvailable() && window_imp->mPreeditor) { @@ -2219,7 +2228,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ case WM_IME_STARTCOMPOSITION: window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_STARTCOMPOSITION"); - if (gDebugWindowProc) + if (debug_window_proc) { LL_INFOS() << "WM_IME_STARTCOMPOSITION" << LL_ENDL; } @@ -2232,7 +2241,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ case WM_IME_ENDCOMPOSITION: window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_ENDCOMPOSITION"); - if (gDebugWindowProc) + if (debug_window_proc) { LL_INFOS() << "WM_IME_ENDCOMPOSITION" << LL_ENDL; } @@ -2244,7 +2253,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ case WM_IME_COMPOSITION: window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_COMPOSITION"); - if (gDebugWindowProc) + if (debug_window_proc) { LL_INFOS() << "WM_IME_COMPOSITION" << LL_ENDL; } @@ -2257,7 +2266,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ case WM_IME_REQUEST: window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_REQUEST"); - if (gDebugWindowProc) + if (debug_window_proc) { LL_INFOS() << "WM_IME_REQUEST" << LL_ENDL; } @@ -2288,7 +2297,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ // characters. We just need to take care of surrogate pairs sent as two WM_CHAR's // by ourselves. It is not that tough. -- Alissa Sabre @ SL window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_CHAR"); - if (gDebugWindowProc) + if (debug_window_proc) { LL_INFOS("Window") << "Debug WindowProc WM_CHAR " << " key " << S32(w_param) @@ -2731,7 +2740,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ S32 width = S32( LOWORD(l_param) ); S32 height = S32( HIWORD(l_param) ); - if (gDebugWindowProc) + if (debug_window_proc) { BOOL maximized = ( w_param == SIZE_MAXIMIZED ); BOOL restored = ( w_param == SIZE_RESTORED ); @@ -2806,7 +2815,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ } case WM_SETFOCUS: - if (gDebugWindowProc) + if (debug_window_proc) { LL_INFOS("Window") << "WINDOWPROC SetFocus" << LL_ENDL; } @@ -2815,7 +2824,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ return 0; case WM_KILLFOCUS: - if (gDebugWindowProc) + if (debug_window_proc) { LL_INFOS("Window") << "WINDOWPROC KillFocus" << LL_ENDL; } @@ -2847,7 +2856,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ break; default: { - if (gDebugWindowProc) + if (debug_window_proc) { LL_INFOS("Window") << "Unhandled windows message code: " << U32(u_msg) << LL_ENDL; } @@ -2857,7 +2866,11 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ window_imp->mCallbacks->handlePauseWatchdog(window_imp); } - + else + { + // (NULL == window_imp) + LL_DEBUGS("Window") << "No window implementation to handle message with, message code: " << U32(u_msg) << LL_ENDL; + } // pass unhandled messages down to Windows return DefWindowProc(h_wnd, u_msg, w_param, l_param); |