diff options
author | Oz Linden <oz@lindenlab.com> | 2017-02-02 15:49:16 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2017-02-02 15:49:16 -0500 |
commit | 1925fd2b8b9216e5d9388e6a0c077c99aa782cad (patch) | |
tree | 2507c9889eb825302f7c3f1650b85e6208b04e4e /indra/llwindow | |
parent | 7f544db197fcaa8a697ee9d9694d11b297a20266 (diff) | |
parent | 080744d8990e6b18a80858803a20a5ec87020d82 (diff) |
merge changes for 5.0.1-release
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/llwindowcallbacks.cpp | 4 | ||||
-rw-r--r-- | indra/llwindow/llwindowcallbacks.h | 2 | ||||
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 26 |
3 files changed, 17 insertions, 15 deletions
diff --git a/indra/llwindow/llwindowcallbacks.cpp b/indra/llwindow/llwindowcallbacks.cpp index 474953d3a4..7e90ade423 100644 --- a/indra/llwindow/llwindowcallbacks.cpp +++ b/indra/llwindow/llwindowcallbacks.cpp @@ -175,9 +175,9 @@ BOOL LLWindowCallbacks::handleDeviceChange(LLWindow *window) return FALSE; } -void LLWindowCallbacks::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height) +BOOL LLWindowCallbacks::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height) { - + return FALSE; } void LLWindowCallbacks::handlePingWatchdog(LLWindow *window, const char * msg) diff --git a/indra/llwindow/llwindowcallbacks.h b/indra/llwindow/llwindowcallbacks.h index de789a71d9..47d5a18858 100644 --- a/indra/llwindow/llwindowcallbacks.h +++ b/indra/llwindow/llwindowcallbacks.h @@ -65,7 +65,7 @@ public: virtual void handleDataCopy(LLWindow *window, S32 data_type, void *data); virtual BOOL handleTimerEvent(LLWindow *window); virtual BOOL handleDeviceChange(LLWindow *window); - virtual void handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height); + virtual BOOL handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height); enum DragNDropAction { DNDA_START_TRACKING = 0,// Start tracking an incoming drag diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 4086db8e52..321792eb14 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -2623,19 +2623,21 @@ 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) / USER_DEFAULT_SCREEN_DPI; + F32 new_scale = F32(LOWORD(w_param)) / F32(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; - window_imp->mCallbacks->handleDPIChanged(window_imp, new_scale, new_width, new_height); - SetWindowPos(h_wnd, - HWND_TOP, - lprc_new_scale->left, - lprc_new_scale->top, - new_width, - new_height, - SWP_NOZORDER | SWP_NOACTIVATE); - return 0; + if (window_imp->mCallbacks->handleDPIChanged(window_imp, new_scale, new_width, new_height)) + { + SetWindowPos(h_wnd, + HWND_TOP, + lprc_new_scale->left, + lprc_new_scale->top, + new_width, + new_height, + SWP_NOZORDER | SWP_NOACTIVATE); + } + return 0; } case WM_SETFOCUS: @@ -3982,7 +3984,7 @@ F32 LLWindowWin32::getSystemUISize() hr = pGDFM(hMonitor, MDT_EFFECTIVE_DPI, &dpix, &dpiy); if (hr == S_OK) { - scale_value = dpix / USER_DEFAULT_SCREEN_DPI; + scale_value = F32(dpix) / F32(USER_DEFAULT_SCREEN_DPI); } else { @@ -4001,7 +4003,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) / USER_DEFAULT_SCREEN_DPI; + scale_value = F32(GetDeviceCaps(hdc, LOGPIXELSX)) / F32(USER_DEFAULT_SCREEN_DPI); } ReleaseDC(hWnd, hdc); |