From f35ae7122d86269ae38c849908ab996a15e15319 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Tue, 27 Feb 2024 08:46:40 +0100 Subject: Stop GUI scaling when window is maximized or full screen (#919) Don't rescale when any top window on same screen as focus window is fullscreen or maximized --- src/Fl_Screen_Driver.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx index c13c6c1fd..d127b6b1e 100644 --- a/src/Fl_Screen_Driver.cxx +++ b/src/Fl_Screen_Driver.cxx @@ -498,10 +498,19 @@ int Fl_Screen_Driver::scale_handler(int event) Fl_Widget *wid = Fl::focus(); if (!wid) return 0; Fl_Window *top = wid->top_window(); - // don't rescale when top window is fullscreen or maximized - if (top->fullscreen_active() || top->maximize_active()) return 0; int screen = Fl_Window_Driver::driver(top)->screen_num(); Fl_Screen_Driver *screen_dr = Fl::screen_driver(); + // don't rescale when any top window on same screen as + // focus window is fullscreen or maximized + top = Fl::first_window(); + while (top) { + if (!top->parent() && + (Fl_Window_Driver::driver(top)->screen_num() == screen || + screen_dr->rescalable() == SYSTEMWIDE_APP_SCALING)) { + if (top->fullscreen_active() || top->maximize_active()) return 0; + } + top = Fl::next_window(top); + } static float initial_scale = screen_dr->scale(screen); #if defined(TEST_SCALING) // test scaling factors: lots of values from 0.3 to 8.0 -- cgit v1.2.3