FLTK logo

[master] 80ecf60 - Wayland: Fix obscure problem when closing file dialog under recent OS versions.

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 80ecf60 - Wayland: Fix obscure problem when closing file dialog under recent OS versions. "ManoloFLTK" Aug 23, 2022  
 
commit 80ecf605ec666da48bb4179ce4ca0ed26d21f3b5
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Tue Aug 23 16:20:47 2022 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Tue Aug 23 16:20:47 2022 +0200

    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 src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
index b935fe6..38230b3 100644
--- src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
+++ 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())
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.