Wayland: Use correct action on fallback decoration

We were previously storing the pointer position only when on the main
window, so when the user clicked on a fallback decoration it would use
the last position of the cursor on the main window, instead of the
position in the decoration surface.

Fixes part of #1991.

(cherry picked from commit 855d338a65)
This commit is contained in:
Emmanuel Gil Peyrot 2021-12-30 19:04:10 +01:00 committed by Camilla Löwy
parent 6afc571ade
commit 17c5c53910
1 changed files with 3 additions and 2 deletions

View File

@ -193,12 +193,12 @@ static void pointerHandleMotion(void* data,
return; return;
x = wl_fixed_to_double(sx); x = wl_fixed_to_double(sx);
y = wl_fixed_to_double(sy); y = wl_fixed_to_double(sy);
window->wl.cursorPosX = x;
window->wl.cursorPosY = y;
switch (window->wl.decorations.focus) switch (window->wl.decorations.focus)
{ {
case mainWindow: case mainWindow:
window->wl.cursorPosX = x;
window->wl.cursorPosY = y;
_glfwInputCursorPos(window, x, y); _glfwInputCursorPos(window, x, y);
_glfw.wl.cursorPreviousName = NULL; _glfw.wl.cursorPreviousName = NULL;
return; return;
@ -298,6 +298,7 @@ static void pointerHandleButton(void* data,
else else
wl_shell_surface_resize(window->wl.shellSurface, _glfw.wl.seat, wl_shell_surface_resize(window->wl.shellSurface, _glfw.wl.seat,
serial, edges); serial, edges);
return;
} }
} }
else if (button == BTN_RIGHT) else if (button == BTN_RIGHT)