summaryrefslogtreecommitdiff
path: root/src/Fl_win32.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-03-01 11:11:15 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-03-01 11:11:15 +0100
commit0eef561e7b9bf54b764e7e7254b98530aac5384f (patch)
tree09755aca065c60ee7f7a2a1f430841f640221765 /src/Fl_win32.cxx
parent5f2069871d00575717d998a2e1e3d398ec9137ef (diff)
Windows: make Ctrl/+/-/0/ scaling system-wide if all screens have same DPI
Diffstat (limited to 'src/Fl_win32.cxx')
-rw-r--r--src/Fl_win32.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index a88a57c19..9aa564650 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -521,6 +521,16 @@ void Fl_WinAPI_Screen_Driver::open_display_platform() {
}
+void Fl_WinAPI_Screen_Driver::update_scaling_capability() {
+ scaling_capability = SYSTEMWIDE_APP_SCALING;
+ for (int ns = 1; ns < screen_count(); ns++) {
+ if (scale(ns) != scale(0)) {
+ scaling_capability = PER_SCREEN_APP_SCALING;
+ break;
+ }
+ }
+}
+
void Fl_WinAPI_Screen_Driver::desktop_scale_factor() {
typedef HRESULT(WINAPI * GetDpiForMonitor_type)(HMONITOR, int, UINT *, UINT *);
typedef HMONITOR(WINAPI * MonitorFromRect_type)(LPCRECT, DWORD);
@@ -544,6 +554,7 @@ void Fl_WinAPI_Screen_Driver::desktop_scale_factor() {
scale(ns, dpiX / 96.f);
// fprintf(LOG, "desktop_scale_factor ns=%d factor=%.2f dpi=%.1f\n", ns, scale(ns), dpi[ns][0]);
}
+ update_scaling_capability();
}
@@ -1207,6 +1218,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
float old_f = float(r.right) / window->w();
Fl::screen_driver()->scale(ns, f);
Fl_Window_Driver::driver(window)->resize_after_scale_change(ns, old_f, f);
+ sd->update_scaling_capability();
}
return 0;
}