FLTK logo

[master] e42666b - Fix part of #1295 related to Wayland and hiding/showing subwindow

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

[master] e42666b - Fix part of #1295 related to Wayland and hiding/showing subwindow "ManoloFLTK" Aug 19, 2025  
 
commit e42666ba68751939270493c94e0b2c379dc5065a
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Tue Aug 19 10:22:52 2025 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Tue Aug 19 10:22:52 2025 +0200

    Fix part of #1295 related to Wayland and hiding/showing subwindow

 src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx | 14 ++++++--------
 src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx |  2 ++
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
index 5225392..ffa1927 100644
--- src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
+++ src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
@@ -218,7 +218,7 @@ static void pointer_enter(void *data, struct wl_pointer *wl_pointer, uint32_t se
     }
   }
   if (!win) return;
-  //fprintf(stderr, "pointer_enter window=%p\n", win);
+  //fprintf(stderr, "pointer_enter window=%p\n", Fl_Wayland_Window_Driver::surface_to_window(surface));
   // use custom cursor if present
   struct wl_cursor *cursor =
     fl_wl_xid(win)->custom_cursor ? fl_wl_xid(win)->custom_cursor->wl_cursor : NULL;
@@ -240,14 +240,12 @@ static void pointer_leave(void *data, struct wl_pointer *wl_pointer,
   Fl_Window *win = Fl_Wayland_Window_Driver::surface_to_window(surface);
   gtk_shell_surface = NULL;
   if (win) {
-    //fprintf(stderr, "pointer_leave surface=%p window=%p\n", surface, win);
+    //fprintf(stderr, "pointer_leave window=%p [%s]\n", win, (win->parent()?"sub":"top"));
     set_event_xy(win);
-    if (!win->parent()) {
-      need_leave = win;
-      wl_display_roundtrip(fl_wl_display()); // pointer_enter to new subwin will run
-      if (need_leave) { // we really leave the window: we don't enter a subwin of it
-        Fl::handle(FL_LEAVE, need_leave);
-      }
+    need_leave = win->top_window(); // we leave a sub or toplevel window
+    wl_display_roundtrip(fl_wl_display()); // pointer_enter to other win, if applicable, will run
+    if (need_leave) { // we really left the sub-or-top win and did not enter another
+      Fl::handle(FL_LEAVE, need_leave);
     }
   }
 }
diff --git src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
index a2f481f..6026db2 100644
--- src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
+++ src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
@@ -453,6 +453,8 @@ void Fl_Wayland_Window_Driver::hide() {
     Fl_Screen_Driver::del_transient_window(NULL);
   }
   Fl_X* ip = Fl_X::flx(pWindow);
+  extern Fl_Window *fl_xmousewin;
+  fl_xmousewin = 0;
   if (hide_common()) return;
   if (ip->region) {
     Fl_Graphics_Driver::default_driver().XDestroyRegion(ip->region);
[ Direct Link to Message ]
 
     
[ Previous Message ] [ Next Message ]
 
 

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