diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2025-05-30 21:38:13 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2025-05-30 21:38:13 +0200 |
| commit | 9a5e3b95b8abe132c36eb58a55f0e5188c726e20 (patch) | |
| tree | e75359b19ffac8a8143bb5b08ddb69e03e2c8e2f /src/drivers | |
| parent | c13594f999ef6fc2c29a15eb1dc65e70aefac96c (diff) | |
Fix for #1260 - part 4: fix when menu button is in subwindow under Wayland
Diffstat (limited to 'src/drivers')
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx index 1a89d28c1..01ce889ca 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx @@ -1170,12 +1170,13 @@ static void popup_configure(void *data, struct xdg_popup *xdg_popup, int32_t x, // make selected item visible, if there's one Fl_Window_Driver::scroll_to_selected_item(window->fl_win); } - if (Fl_Window_Driver::current_menu_button && !Fl_Window_Driver::menu_leftorigin(window->fl_win) && - y < Fl_Window_Driver::current_menu_button->y()) { + if (Fl_Window_Driver::current_menu_button && !Fl_Window_Driver::menu_leftorigin(window->fl_win)) { + int X, Y; + Fl_Window_Driver::current_menu_button->top_window_offset(X, Y); + if (y < Y) { Fl_Window *win = window->fl_win; - int Y = win->y(); - win->Fl_Widget::resize(win->x(), Y - win->h() - Fl_Window_Driver::current_menu_button->h(), - win->w(), win->h()); + win->Fl_Widget::resize(win->x(), Y - win->h(), win->w(), win->h()); + } } } @@ -1334,12 +1335,12 @@ bool Fl_Wayland_Window_Driver::process_menu_or_tooltip(struct wld_window *new_wi //xdg_positioner_get_version(positioner) <== gives 1 under Debian and Sway int popup_x, popup_y; if (Fl_Window_Driver::current_menu_button && !Fl_Window_Driver::menu_leftorigin(pWindow)) { - xdg_positioner_set_anchor_rect(positioner, - Fl_Window_Driver::current_menu_button->x() * f, - Fl_Window_Driver::current_menu_button->y() * f, + int X, Y; + Fl_Window_Driver::current_menu_button->top_window_offset(X, Y); + xdg_positioner_set_anchor_rect(positioner, X * f, Y * f, Fl_Window_Driver::current_menu_button->w() * f, Fl_Window_Driver::current_menu_button->h() * f); - popup_x = Fl_Window_Driver::current_menu_button->x() * f; + popup_x = X * f; popup_y = 0; if (parent_xid->kind == Fl_Wayland_Window_Driver::DECORATED && !origin_win->fullscreen_active()) libdecor_frame_translate_coordinate(parent_xid->frame, popup_x, popup_y, |
