summaryrefslogtreecommitdiff
path: root/src/Fl_Screen_Driver.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-02-27 08:46:40 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-02-27 08:46:40 +0100
commitf35ae7122d86269ae38c849908ab996a15e15319 (patch)
treea085b568f74f93e5f491557e225d6763da70d96f /src/Fl_Screen_Driver.cxx
parent3f794d3abe35648236963b0e2ba513cfab48fe83 (diff)
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
Diffstat (limited to 'src/Fl_Screen_Driver.cxx')
-rw-r--r--src/Fl_Screen_Driver.cxx13
1 files changed, 11 insertions, 2 deletions
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