summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-03-22 02:12:20 +0100
committerwm4 <wm4@nowhere>2014-03-22 02:12:20 +0100
commitba62e01cd391be2c652897b7a4b0bde8176e390f (patch)
tree69ac6ec4e21c4080f8623979ebbba0db75650fe0 /video/out
parentf705bbb2d5e5566fd9be7f144bd983c27ba5285d (diff)
downloadmpv-ba62e01cd391be2c652897b7a4b0bde8176e390f.tar.bz2
mpv-ba62e01cd391be2c652897b7a4b0bde8176e390f.tar.xz
x11_common: fix some problems with window dragging
There were some bad interactions with the OSC. For one, dragging the OSC bar, and then moving the mouse outside of the OSC (while mouse button still held) would suddenly initiate window dragging. This was because win_drag_button1_down was not reset when sending a normal mouse event, which means the window dragging code can become active even after we've basically decided that the preceding click didn't initiate window dragging. Second, dragging the window and clicking on the OSC bar after that did nothing. This was because no mouse button up event was sent to the core, even though a mouse down event was sent. So make sure the key state is erased with MP_INPUT_RELEASE_ALL.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/x11_common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index d92ffcdea4..da8d878b6b 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -949,8 +949,8 @@ int vo_x11_check_events(struct vo *vo)
!mp_input_test_dragging(vo->input_ctx, Event.xmotion.x,
Event.xmotion.y))
{
+ mp_input_put_key(vo->input_ctx, MP_INPUT_RELEASE_ALL);
XUngrabPointer(x11->display, CurrentTime);
- x11->win_drag_button1_down = false;
XEvent xev;
xev.xclient.type = ClientMessage;
@@ -971,6 +971,7 @@ int vo_x11_check_events(struct vo *vo)
} else {
vo_mouse_movement(vo, Event.xmotion.x, Event.xmotion.y);
}
+ x11->win_drag_button1_down = false;
break;
case LeaveNotify:
x11->win_drag_button1_down = false;