summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-06-13 14:39:03 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-06-13 14:39:03 +0200
commit742af8a31a8627bdfc1ed4d14cdc73c396c015f6 (patch)
treee15fa6c44adc57550b1c6072ff6db3d345c87a55
parent3166416e4c1add5c768f8a96377bb3af141eec67 (diff)
Wayland: fix menutitle windows with scaled, multiple display
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
index 735d8b527..eec088e6c 100644
--- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
@@ -1172,6 +1172,8 @@ bool Fl_Wayland_Window_Driver::process_menu_or_tooltip(struct wld_window *new_wi
//libdecor_frame_popup_grab(parent_xid->frame, scr_driver->get_seat_name());
}
wl_surface_commit(new_window->wl_surface);
+ // put it on same screen as parent_win
+ this->screen_num(parent_win->screen_num());
return false;
}
@@ -1322,7 +1324,10 @@ void Fl_Wayland_Window_Driver::makeWindow()
xdg_surface_add_listener(xid->xdg_surface, &xdg_surface_listener, xid);
struct xdg_positioner *positioner = xdg_wm_base_create_positioner(scr_driver->xdg_wm_base);
xdg_positioner_set_anchor_rect(positioner, 0, 0, 1, 1);
- float f = Fl::screen_scale(Fl_Window_Driver::menu_parent()->screen_num());
+ int snum = Fl_Window_Driver::menu_parent()->screen_num();
+ float f = Fl::screen_scale(snum);
+ // put it on same screen as parent menu
+ Fl_Window_Driver::driver(previous_floatingtitle)->screen_num(snum);
xdg_positioner_set_size(positioner, previous_floatingtitle->w() * f , previous_floatingtitle->h() * f );
xdg_positioner_set_anchor(positioner, XDG_POSITIONER_ANCHOR_TOP_LEFT);
xdg_positioner_set_gravity(positioner, XDG_POSITIONER_GRAVITY_TOP_RIGHT);