From 1ae8fcbcecc6f3113463588a4080ace93af7b00e Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Wed, 18 Mar 2026 12:28:56 +0100 Subject: [PATCH] Wayland: fix computation of wld_scale parameter for GL subwindows (#1382) --- src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx index f05c837e5..cb28755f7 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx @@ -723,7 +723,7 @@ static void surface_enter(void *data, struct wl_surface *wl_surface, while (e->next != &window->outputs) e = e->next; // move e to end of linked list wl_list_insert(e, &surface_output->link); //printf("window %p enters screen id=%d length=%d\n", window->fl_win, output->id, wl_list_length(&window->outputs)); - if (list_was_empty && !window->fl_win->parent() && !window->fl_win->menu_window()) { + if (list_was_empty && (!window->fl_win->parent() || window->fl_win->as_gl_window()) && !window->fl_win->menu_window()) { change_scale(output, window, pre_scale); } } @@ -2122,13 +2122,7 @@ int Fl_Wayland_Window_Driver::wld_scale() { Fl_X *flx = Fl_X::flx(pWindow->top_window()); struct wld_window *xid = (flx ? (struct wld_window *)flx->xid : NULL); if (!xid || wl_list_empty(&xid->outputs)) { - int scale = 1; - Fl_Wayland_Screen_Driver *scr_driver = (Fl_Wayland_Screen_Driver*)Fl::screen_driver(); - Fl_Wayland_Screen_Driver::output *output; - wl_list_for_each(output, &(scr_driver->outputs), link) { - scale = fl_max(scale, output->wld_scale); - } - return scale; + return 1; } struct surface_output *s_output; s_output = wl_container_of(xid->outputs.next, s_output, link);