From 80ecf605ec666da48bb4179ce4ca0ed26d21f3b5 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Tue, 23 Aug 2022 16:20:47 +0200 Subject: [PATCH] Wayland: Fix obscure problem when closing file dialog under recent OS versions. The problem is that the app sometimes stops after closing a file dialog window. It results in fact from a bug in function draw_title_bar of libdecor-gtk.c that erroneously calls libdecor_frame_set_max_content_size(). This bug is being proposed to be fixed by a MR to libdecor. But moving the libdecor_frame_set_min/max_content_size() calls after the capability changes hides the bug, and the problem with file dialog doesn't show. --- src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx index b935fe604..38230b3db 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx @@ -528,8 +528,6 @@ void Fl_Wayland_Window_Driver::size_range() { struct wld_window *wl_win = ip->xid; float f = Fl::screen_scale(pWindow->screen_num()); if (wl_win->kind == DECORATED && wl_win->frame) { - libdecor_frame_set_min_content_size(wl_win->frame, minw()*f, minh()*f); - libdecor_frame_set_max_content_size(wl_win->frame, maxw()*f, maxh()*f); int X,Y,W,H; Fl::screen_work_area(X,Y,W,H, Fl::screen_num(x(),y(),w(),h())); if (maxw() && maxw() < W && maxh() && maxh() < H) { @@ -542,6 +540,8 @@ void Fl_Wayland_Window_Driver::size_range() { } else { libdecor_frame_set_capabilities(wl_win->frame, LIBDECOR_ACTION_RESIZE); } + libdecor_frame_set_min_content_size(wl_win->frame, minw()*f, minh()*f); + libdecor_frame_set_max_content_size(wl_win->frame, maxw()*f, maxh()*f); } else if (wl_win->kind == UNFRAMED && wl_win->xdg_toplevel) { xdg_toplevel_set_min_size(wl_win->xdg_toplevel, minw()*f, minh()*f); if (maxw() && maxh())