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 --- doc/contributions.txt | 1 + indra/llwindow/llwindowwin32.cpp | 19 ++++++++++++++++++- indra/llwindow/llwindowwin32.h | 2 ++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index 5307c5345c..923892a3ff 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -216,6 +216,7 @@ Ansariel Hiller MAINT-7059 MAINT-6519 MAINT-7899 + STORM-2151 Aralara Rajal Arare Chantilly CHUIBUG-191 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