summaryrefslogtreecommitdiffstats
path: root/video/out/x11_common.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-03-18 20:38:23 +0100
committerwm4 <wm4@nowhere>2014-03-18 20:43:45 +0100
commit19f101db680f966a6e56035a16784541be390982 (patch)
tree28cbf61aa9d0c2ec05f141c79022cc90a5883ec5 /video/out/x11_common.h
parent4751fe408be9c1278149e234f45570b70f4a57ce (diff)
downloadmpv-19f101db680f966a6e56035a16784541be390982.tar.bz2
mpv-19f101db680f966a6e56035a16784541be390982.tar.xz
x11: implement window dragging by grabbing
We don't check whether the WM supports _NET_WM_MOVERESIZE_MOVE, but if it doesn't, nothing bad happens. There might be a race condition when pressing a button, and then moving the mouse and releasing the button at the same time; then the WM might get the message to initiate moving the window after the mouse button has been released, in which case the result will probably be annoying. This could possibly be fixed by sending _NET_WM_MOVERESIZE_CANCEL on button release, but on the other hand, we probably won't receive a button release event in this situation, so ignore this problem. The dragging is initiated only when moving the mouse pointer after a click in order to reduce annoying behavior when the user is e.g. doubleclicking. Closes #608.
Diffstat (limited to 'video/out/x11_common.h')
-rw-r--r--video/out/x11_common.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/video/out/x11_common.h b/video/out/x11_common.h
index ac41f6e3ed..23ece3f9c3 100644
--- a/video/out/x11_common.h
+++ b/video/out/x11_common.h
@@ -107,6 +107,9 @@ struct vo_x11_state {
Atom dnd_requested_format;
Window dnd_src_window;
+ /* dragging the window */
+ bool win_drag_button1_down;
+
Atom XA_NET_SUPPORTED;
Atom XA_NET_WM_STATE;
Atom XA_NET_WM_STATE_FULLSCREEN;
@@ -117,6 +120,7 @@ struct vo_x11_state {
Atom XA_NET_WM_NAME;
Atom XA_NET_WM_ICON_NAME;
Atom XA_NET_WM_ICON;
+ Atom XA_NET_WM_MOVERESIZE;
Atom XA_WIN_PROTOCOLS;
Atom XA_WIN_LAYER;
Atom XA_WIN_HINTS;