From f1c76a376c1aeb194ddf7cfddc7e50fd4a9645af Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 16 Oct 2017 10:41:45 +0200 Subject: STORM-2151: Respect "Hide cursor while typing" user setting on Windows --- indra/llwindow/llwindowwin32.cpp | 19 ++++++++++++++++++- indra/llwindow/llwindowwin32.h | 2 ++ 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index b5ed53fd4f..62179e4d80 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -421,6 +421,11 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, mKeyVirtualKey = 0; mhDC = NULL; mhRC = NULL; + + if (!SystemParametersInfo(SPI_GETMOUSEVANISH, 0, &mMouseVanish, 0)) + { + mMouseVanish = TRUE; + } // Initialize the keyboard gKeyboard = new LLKeyboardWin32(); @@ -1680,7 +1685,7 @@ void LLWindowWin32::showCursorFromMouseMove() void LLWindowWin32::hideCursorUntilMouseMove() { - if (!mHideCursorPermanent) + if (!mHideCursorPermanent && mMouseVanish) { hideCursor(); mHideCursorPermanent = FALSE; @@ -2668,6 +2673,18 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ return 0; break; + + case WM_SETTINGCHANGE: + { + if (w_param == SPI_SETMOUSEVANISH) + { + if (!SystemParametersInfo(SPI_GETMOUSEVANISH, 0, &window_imp->mMouseVanish, 0)) + { + window_imp->mMouseVanish = TRUE; + } + } + } + break; } window_imp->mCallbacks->handlePauseWatchdog(window_imp); diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 39ef9b31a4..cd6e5e4fa8 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -214,6 +214,8 @@ protected: U32 mRawWParam; U32 mRawLParam; + BOOL mMouseVanish; + friend class LLWindowManager; }; -- cgit v1.2.3 From bafe54c1fe5f83552a6be6c10b0f3b6e3ef69859 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 17 Jan 2018 18:46:56 +0200 Subject: MAINT-8183 Additional logging --- indra/llwindow/llwindowwin32.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 2ad6f7c8b5..9fa07d1d34 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -1101,7 +1101,14 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO mhInstance, NULL); - LL_INFOS("Window") << "window is created." << LL_ENDL ; + if (mWindowHandle) + { + LL_INFOS("Window") << "window is created." << LL_ENDL ; + } + else + { + LL_WARNS("Window") << "Window creation failed, code: " << GetLastError() << LL_ENDL; + } //----------------------------------------------------------------------- // Create GL drawing context @@ -1416,7 +1423,16 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO mhInstance, NULL); - LL_INFOS("Window") << "recreate window done." << LL_ENDL ; + + if (mWindowHandle) + { + LL_INFOS("Window") << "recreate window done." << LL_ENDL ; + } + else + { + // Note: if value is NULL GetDC retrieves the DC for the entire screen. + LL_WARNS("Window") << "Window recreation failed, code: " << GetLastError() << LL_ENDL; + } if (!(mhDC = GetDC(mWindowHandle))) { @@ -2646,20 +2662,20 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ } case WM_SETFOCUS: - window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_SETFOCUS"); if (gDebugWindowProc) { LL_INFOS("Window") << "WINDOWPROC SetFocus" << LL_ENDL; } + window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_SETFOCUS"); window_imp->mCallbacks->handleFocus(window_imp); return 0; case WM_KILLFOCUS: - window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_KILLFOCUS"); if (gDebugWindowProc) { LL_INFOS("Window") << "WINDOWPROC KillFocus" << LL_ENDL; } + window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_KILLFOCUS"); window_imp->mCallbacks->handleFocusLost(window_imp); return 0; -- cgit v1.2.3