summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorAnsariel <none@none>2016-09-20 21:16:39 +0200
committerAnsariel <none@none>2016-09-20 21:16:39 +0200
commitbb7cbe7cff43bec7061a7a0ccabaf2755e7376ee (patch)
treee8b21e965ba0acb805010799241573afb22d0e95 /indra/llwindow
parentc94496db9ea8ae872dd3d40b53a6329571322629 (diff)
Small improvements to UI DPI scaling on Windows:
* Use USER_DEFAULT_SCREEN_DPI define from WinUser.h * Change Win32 SDK target version to Windows Vista or greater * Define WM_DPICHANGED as preprocessor definition as in WinUser.h * Cull manual definitions of WM_MOUSEWHEEL and WHEEL_DELTA which are part of the Win32 SDK since Windows NT 4.0
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llwindowwin32.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 26bc819aab..4086db8e52 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -60,21 +60,13 @@
#include <dinput.h>
#include <Dbt.h.>
-// culled from winuser.h
-#ifndef WM_MOUSEWHEEL /* Added to be compatible with later SDK's */
-const S32 WM_MOUSEWHEEL = 0x020A;
-#endif
-#ifndef WHEEL_DELTA /* Added to be compatible with later SDK's */
-const S32 WHEEL_DELTA = 120; /* Value for rolling one detent */
-#endif
const S32 MAX_MESSAGE_PER_UPDATE = 20;
const S32 BITS_PER_PIXEL = 32;
const S32 MAX_NUM_RESOLUTIONS = 32;
const F32 ICON_FLASH_TIME = 0.5f;
-const F32 DEFAULT_DPI = 96.0f;
-#ifndef WM_DPICHANGED
-const S32 WM_DPICHANGED = 0x02E0;
+#ifndef WM_DPICHANGED
+#define WM_DPICHANGED 0x02E0
#endif
extern BOOL gDebugWindowProc;
@@ -2631,7 +2623,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_DPICHANGED:
{
LPRECT lprc_new_scale;
- F32 new_scale = LOWORD(w_param) / 96.0f;
+ F32 new_scale = LOWORD(w_param) / USER_DEFAULT_SCREEN_DPI;
lprc_new_scale = (LPRECT)l_param;
S32 new_width = lprc_new_scale->right - lprc_new_scale->left;
S32 new_height = lprc_new_scale->bottom - lprc_new_scale->top;
@@ -3990,7 +3982,7 @@ F32 LLWindowWin32::getSystemUISize()
hr = pGDFM(hMonitor, MDT_EFFECTIVE_DPI, &dpix, &dpiy);
if (hr == S_OK)
{
- scale_value = dpix / DEFAULT_DPI;
+ scale_value = dpix / USER_DEFAULT_SCREEN_DPI;
}
else
{
@@ -4009,7 +4001,7 @@ F32 LLWindowWin32::getSystemUISize()
else
{
LL_WARNS() << "Could not load shcore.dll library (included by <ShellScalingAPI.h> from Win 8.1 SDK). Using legacy DPI awareness API of Win XP/7" << LL_ENDL;
- scale_value = GetDeviceCaps(hdc, LOGPIXELSX) / DEFAULT_DPI;
+ scale_value = GetDeviceCaps(hdc, LOGPIXELSX) / USER_DEFAULT_SCREEN_DPI;
}
ReleaseDC(hWnd, hdc);