diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-09-14 15:08:03 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-09-14 15:08:03 +0200 |
| commit | 382d6b2fbdb441ef8cbbe52a7dc07032aa733188 (patch) | |
| tree | 4f1caf9e7a5189690d10ee0239bb2192a656f5fd | |
| parent | e7f1247552fbb9d056d4c68eb51564a504df3161 (diff) | |
Bypass Mutter bug for menubar in fullscreen window (see #1061)
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx index 58cd74f5a..46df38e6b 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx @@ -1351,12 +1351,19 @@ bool Fl_Wayland_Window_Driver::process_menu_or_tooltip(struct wld_window *new_wi xdg_positioner_set_anchor(positioner, XDG_POSITIONER_ANCHOR_BOTTOM_LEFT); xdg_positioner_set_gravity(positioner, XDG_POSITIONER_GRAVITY_BOTTOM_RIGHT); // prevent menuwindow from expanding beyond display limits - int constraint = XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X | - XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_Y; - if (Fl_Window_Driver::menu_bartitle(pWindow) && !Fl_Window_Driver::menu_leftorigin(pWindow)) { - constraint |= XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y; + int constraint = 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))) + ) { + // 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); + if (Fl_Window_Driver::menu_bartitle(pWindow) && !Fl_Window_Driver::menu_leftorigin(pWindow)) { + constraint |= XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y; + } + xdg_positioner_set_constraint_adjustment(positioner, constraint); } - xdg_positioner_set_constraint_adjustment(positioner, constraint); if (!(Fl_Window_Driver::menu_title(pWindow) && Fl_Window_Driver::menu_bartitle(pWindow))) { xdg_positioner_set_offset(positioner, 0, popup_y); } |
