diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2014-04-30 16:52:30 -0700 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2014-04-30 16:52:30 -0700 |
commit | 8c3c738718adf99d777cfdf37308806c231447ca (patch) | |
tree | 3fe55e827e4d2e7385b6ffdb1a5a4c35e5410c4a /xwayland | |
parent | e5c1ae9368821379e0028cd8dc0fa7e039f84c21 (diff) |
xwayland: Handle race between multi-pointer motion and clicks
Make sure we're looking at the right location. The frame could have
received a motion event from a pointer from a different wl_seat, but
under X it looks like our core pointer moved. Move the frame pointer
to the button press location before deciding what to do.
Diffstat (limited to 'xwayland')
-rw-r--r-- | xwayland/window-manager.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index dd0118ef..a7afd84f 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -1629,6 +1629,13 @@ weston_wm_handle_button(struct weston_wm *wm, xcb_generic_event_t *event) FRAME_BUTTON_PRESSED : FRAME_BUTTON_RELEASED; button_id = button->detail == 1 ? BTN_LEFT : BTN_RIGHT; + /* Make sure we're looking at the right location. The frame + * could have received a motion event from a pointer from a + * different wl_seat, but under X it looks like our core + * pointer moved. Move the frame pointer to the button press + * location before deciding what to do. */ + location = frame_pointer_motion(window->frame, NULL, + button->event_x, button->event_y); location = frame_pointer_button(window->frame, NULL, button_id, button_state); if (frame_status(window->frame) & FRAME_STATUS_REPAINT) |