mirror of
https://github.com/mpv-player/mpv
synced 2025-03-05 21:57:39 +00:00
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.
This commit is contained in:
parent
bbb1057d06
commit
6a4e59677e
@ -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);
|
||||
}
|
||||
|
||||
|
@ -71,6 +71,8 @@ struct vo_wayland_state {
|
||||
float aspect;
|
||||
|
||||
struct wl_surface *surface;
|
||||
int32_t surf_x;
|
||||
int32_t surf_y;
|
||||
struct wl_shell_surface *shell_surface;
|
||||
int events; /* mplayer events (VO_EVENT_RESIZE) */
|
||||
} window;
|
||||
|
Loading…
Reference in New Issue
Block a user