diff options
author | Alexander Preisinger <alexander.preisinger@gmail.com> | 2013-09-24 19:15:55 +0200 |
---|---|---|
committer | Alexander Preisinger <alexander.preisinger@gmail.com> | 2013-10-20 09:25:28 +0200 |
commit | 6a4e59677e1d0e4b5c6df8a25c3c9a55ac97e25f (patch) | |
tree | f45ce26653cac590dcb8562237ec7c0df1df5e35 /video/out/wayland_common.c | |
parent | bbb1057d0667ea1d87b615792c5e1536f4248cd2 (diff) | |
download | mpv-6a4e59677e1d0e4b5c6df8a25c3c9a55ac97e25f.tar.bz2 mpv-6a4e59677e1d0e4b5c6df8a25c3c9a55ac97e25f.tar.xz |
wayland: use mp_input_test_dragging
Instead of removing dragging we now test if it we should drag the window or
not. Because if the OSC shows up we can not drag the window because that would
cause mouse events that makes the OSC disappear.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r-- | video/out/wayland_common.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 109e2dc4b0..fedb0fc561 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -337,9 +337,11 @@ static void pointer_handle_motion(void *data, struct vo_wayland_state *wl = data; wl->cursor.pointer = pointer; + wl->window.surf_x = wl_fixed_to_int(sx_w); + wl->window.surf_y = wl_fixed_to_int(sy_w); - vo_mouse_movement(wl->vo, wl_fixed_to_int(sx_w), - wl_fixed_to_int(sy_w)); + vo_mouse_movement(wl->vo, wl->window.surf_x, + wl->window.surf_y); } static void pointer_handle_button(void *data, @@ -355,7 +357,8 @@ static void pointer_handle_button(void *data, ((state == WL_POINTER_BUTTON_STATE_PRESSED) ? MP_KEY_STATE_DOWN : MP_KEY_STATE_UP)); - if ((button == BTN_LEFT) && (state == WL_POINTER_BUTTON_STATE_PRESSED)) + if (!mp_input_test_dragging(wl->vo->input_ctx, wl->window.surf_x, wl->window.surf_y) && + (button == BTN_LEFT) && (state == WL_POINTER_BUTTON_STATE_PRESSED)) wl_shell_surface_move(wl->window.shell_surface, wl->input.seat, serial); } |