Windows: improve support of screen configuration changes while FLTK app runs.
Build and Test / build-linux (push) Waiting to run
Build and Test / build-wayland (push) Waiting to run
Build and Test / build-macos (push) Waiting to run
Build and Test / build-windows (push) Waiting to run

This commit is contained in:
ManoloFLTK
2026-05-29 11:45:55 +02:00
parent 34c23c6b71
commit b058f216c4
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -568,7 +568,7 @@ void Fl_WinAPI_Screen_Driver::desktop_scale_factor() {
dpi[ns][0] = float(dpiX);
dpi[ns][1] = float(dpiY);
scale(ns, dpiX / 96.f);
// fprintf(LOG, "desktop_scale_factor ns=%d factor=%.2f dpi=%.1f\n", ns, scale(ns), dpi[ns][0]);
// fprintf(stderr, "desktop_scale_factor ns=%d factor=%.2f dpi=%.1f\n", ns, scale(ns), dpi[ns][0]);
}
update_scaling_capability();
}
@@ -1879,7 +1879,10 @@ content key keyboard layout
return 1;
case WM_DISPLAYCHANGE: {// when screen configuration (number, size, position) changes
Fl_WinAPI_Screen_Driver *sd = (Fl_WinAPI_Screen_Driver*)Fl::screen_driver();
sd->screen_count_set(-1);
Fl::call_screen_init();
sd->desktop_scale_factor();
Fl::handle(FL_SCREEN_CONFIGURATION_CHANGED, NULL);
return 0;
}
@@ -43,6 +43,7 @@ public:
float dpi[MAX_SCREENS][2];
enum APP_SCALING_CAPABILITY scaling_capability;
void update_scaling_capability();
void screen_count_set(int count) { num_screens = count; }
Fl_WinAPI_Screen_Driver();
// --- display management
int visual(int flags) FL_OVERRIDE;