diff --git a/indra/llwindow/llwindowcallbacks.cpp b/indra/llwindow/llwindowcallbacks.cpp index 474953d3a4..b4ed7d81db 100644 --- a/indra/llwindow/llwindowcallbacks.cpp +++ b/indra/llwindow/llwindowcallbacks.cpp @@ -175,10 +175,16 @@ BOOL LLWindowCallbacks::handleDeviceChange(LLWindow *window) return FALSE; } -void LLWindowCallbacks::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height) -{ +// FIRE-20416: Option for automatic UI scaling +//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 TRUE; } +// void LLWindowCallbacks::handlePingWatchdog(LLWindow *window, const char * msg) { diff --git a/indra/llwindow/llwindowcallbacks.h b/indra/llwindow/llwindowcallbacks.h index de789a71d9..581c434ef4 100644 --- a/indra/llwindow/llwindowcallbacks.h +++ b/indra/llwindow/llwindowcallbacks.h @@ -65,7 +65,10 @@ 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); + // FIRE-20416: Option for automatic UI scaling + //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 f55be68520..1c36188f5d 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -2651,7 +2651,10 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ 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); + // FIRE-20416: Option for automatic UI scaling + //window_imp->mCallbacks->handleDPIChanged(window_imp, new_scale, new_width, new_height); + if (window_imp->mCallbacks->handleDPIChanged(window_imp, new_scale, new_width, new_height)) + // SetWindowPos(h_wnd, HWND_TOP, lprc_new_scale->left, diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 372319818e..ab4bd4c515 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -24224,6 +24224,17 @@ Change of this parameter will affect the layout of buttons in notification toast Value 1 + FSEnableAutomaticUIScaling + + Comment + If enabled, the viewer will try to detect the correct factor based on the scaling set in the operating system. This feature is currently only available on Windows. + Persist + 1 + Type + Boolean + Value + 1 + diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 35f68d3b42..685b23a0a4 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1670,17 +1670,29 @@ BOOL LLViewerWindow::handleDeviceChange(LLWindow *window) return FALSE; } -void LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height) +// FIRE-20416: Option for automatic UI scaling +//void LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height) +BOOL LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height) +// { + // FIRE-20416: Option for automatic UI scaling + if (!gSavedSettings.getBOOL("FSEnableAutomaticUIScaling")) + { + return FALSE; + } + // + if (ui_scale_factor >= MIN_UI_SCALE && ui_scale_factor <= MAX_UI_SCALE) { gSavedSettings.setF32("UIScaleFactor", ui_scale_factor); LLViewerWindow::reshape(window_width, window_height); mResDirty = true; + return TRUE; // FIRE-20416: Option for automatic UI scaling } else { LL_WARNS() << "DPI change caused UI scale to go out of bounds: " << ui_scale_factor << LL_ENDL; + return FALSE; // FIRE-20416: Option for automatic UI scaling } } @@ -1847,7 +1859,10 @@ LLViewerWindow::LLViewerWindow(const Params& p) // reset to default; system_scale_factor = 1.f; } - if (p.first_run || gSavedSettings.getF32("LastSystemUIScaleFactor") != system_scale_factor) + // FIRE-20416: Option for automatic UI scaling + //if (p.first_run || gSavedSettings.getF32("LastSystemUIScaleFactor") != system_scale_factor) + if (p.first_run || (gSavedSettings.getBOOL("FSEnableAutomaticUIScaling") && gSavedSettings.getF32("LastSystemUIScaleFactor") != system_scale_factor)) + // { mSystemUIScaleFactorChanged = !p.first_run; gSavedSettings.setF32("LastSystemUIScaleFactor", system_scale_factor); diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 8308661445..8fafb2ccc7 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -212,7 +212,10 @@ 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); + // FIRE-20416: Option for automatic UI scaling + /*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); + // /*virtual*/ void handlePingWatchdog(LLWindow *window, const char * msg); /*virtual*/ void handlePauseWatchdog(LLWindow *window); diff --git a/indra/newview/skins/default/xui/de/panel_preferences_UI.xml b/indra/newview/skins/default/xui/de/panel_preferences_UI.xml index 9da3960774..b772f65fd4 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_UI.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_UI.xml @@ -33,9 +33,10 @@ - - UI-Skalierung (Nebeneffekte möglich): + + UI-Skalierung: + Skriptdialoge pro Objekt: diff --git a/indra/newview/skins/default/xui/en/panel_preferences_UI.xml b/indra/newview/skins/default/xui/en/panel_preferences_UI.xml index 4baaee1bf7..886e4655a0 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_UI.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_UI.xml @@ -244,7 +244,6 @@ follows="all" label="2D Overlay" name="ui-2d-overlay" > - - UI Scaling (may cause side effects): + width="60"> + UI Scaling: + width="390" /> + +