diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-11-15 11:48:45 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-11-15 11:48:45 +0100 |
| commit | dd1c2fc843c4365628a6190fbebdae2ee92b2422 (patch) | |
| tree | c1735b64f082347b68211d6a6a94053f475d3d1e | |
| parent | 605328e045e48af6561546deccd659ae620b7966 (diff) | |
Wayland: fix moving top-level window around with mouse
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx index 6b5b2f8ab..bc4060930 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx @@ -1816,9 +1816,6 @@ void Fl_Wayland_Window_Driver::resize(int X, int Y, int W, int H) { if (fl_win && fl_win->kind == DECORATED && !xdg_toplevel()) { pWindow->wait_for_expose(); } - // toplevel, non-popup windows must have origin at 0,0 - if (!pWindow->parent() && - !(pWindow->menu_window() || pWindow->tooltip_window())) X = Y = 0; int is_a_move = (X != x() || Y != y()); bool true_rescale = Fl_Window::is_a_rescale(); if (fl_win && fl_win->buffer) { @@ -1836,6 +1833,9 @@ void Fl_Wayland_Window_Driver::resize(int X, int Y, int W, int H) { if (W < 1) W = 1; if (H < 1) H = 1; } + // toplevel, non-popup windows must have origin at 0,0 + if (!pWindow->parent() && + !(pWindow->menu_window() || pWindow->tooltip_window())) X = Y = 0; pWindow->Fl_Group::resize(X,Y,W,H); //fprintf(stderr, "resize: win=%p to %dx%d\n", pWindow, W, H); if (shown()) {pWindow->redraw();} @@ -1900,7 +1900,9 @@ void Fl_Wayland_Window_Driver::resize(int X, int Y, int W, int H) { // Wayland doesn't seem to provide a reliable way for the app to set the // window position on screen. This is functional when the move is mouse-driven. Fl_Wayland_Screen_Driver *scr_driver = (Fl_Wayland_Screen_Driver*)Fl::screen_driver(); - xdg_toplevel_move(xdg_toplevel(), scr_driver->seat->wl_seat, scr_driver->seat->serial); + if (Fl::e_state == FL_BUTTON1) { + xdg_toplevel_move(xdg_toplevel(), scr_driver->seat->wl_seat, scr_driver->seat->serial); + } } else if (fl_win->kind == SUBWINDOW && fl_win->subsurface) { wl_subsurface_set_position(fl_win->subsurface, pWindow->x() * f, pWindow->y() * f); } |
