summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2025-06-10 17:03:09 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2025-06-10 17:03:29 +0200
commitac294f734868b0e8437b02d6524a7096b5125eb6 (patch)
treee67c9ca2b1659076d9d67661603a7983fcc54ce0
parent340caa2dc313beb2589b386c6b052ba81e36cc3e (diff)
Fix "Selecting menus from the menubar under Wayland when in fullscreen" (#1264)
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
index 01ce889ca..ba961020d 100644
--- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
@@ -1388,10 +1388,14 @@ bool Fl_Wayland_Window_Driver::process_menu_or_tooltip(struct wld_window *new_wi
xdg_positioner_set_gravity(positioner, XDG_POSITIONER_GRAVITY_BOTTOM_RIGHT);
// prevent menuwindow from expanding beyond display limits
int constraint = 0;
+ int top_menubar = pWindow->y() -
+ (Fl_Window_Driver::menu_bartitle(pWindow) && Fl_Window_Driver::menu_title(pWindow) ?
+ Fl_Window_Driver::menu_title(pWindow)->h() : 0);
if ( !(parent_win->fullscreen_active() &&
Fl_Wayland_Screen_Driver::compositor == Fl_Wayland_Screen_Driver::MUTTER &&
((!Fl_Window_Driver::menu_title(pWindow) && !Fl_Window_Driver::menu_leftorigin(pWindow)) ||
- Fl_Window_Driver::menu_bartitle(pWindow)) && pWindow->y() < 10 && !Fl_Window_Driver::current_menu_button)
+ Fl_Window_Driver::menu_bartitle(pWindow)) && top_menubar < 10 &&
+ !Fl_Window_Driver::current_menu_button)
) {
// Condition above is only to bypass Mutter bug for fullscreen windows (see #1061)
constraint |= (XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X | XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_Y);