summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/client-api-changes.rst1
-rw-r--r--libmpv/client.h2
-rw-r--r--video/out/x11_common.c15
3 files changed, 12 insertions, 6 deletions
diff --git a/DOCS/client-api-changes.rst b/DOCS/client-api-changes.rst
index bef6759877..b689921e48 100644
--- a/DOCS/client-api-changes.rst
+++ b/DOCS/client-api-changes.rst
@@ -25,6 +25,7 @@ API changes
::
+ 1.4 - subtle change in X11 and "--wid" behavior
--- mpv 0.5.0 is released ---
1.3 - add MPV_MAKE_VERSION()
1.2 - remove "stream-time-pos" property (no replacement)
diff --git a/libmpv/client.h b/libmpv/client.h
index b9ec85576c..1b41a43361 100644
--- a/libmpv/client.h
+++ b/libmpv/client.h
@@ -162,7 +162,7 @@ extern "C" {
* relational operators (<, >, <=, >=).
*/
#define MPV_MAKE_VERSION(major, minor) (((major) << 16) | (minor) | 0UL)
-#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 3)
+#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 4)
/**
* Return the MPV_CLIENT_API_VERSION the mpv source has been compiled with.
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index e9389c5f38..9da95ab200 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -1242,11 +1242,16 @@ static void vo_x11_map_window(struct vo *vo, struct mp_rect rc)
}
// map window
- vo_x11_selectinput_witherr(vo, x11->display, x11->window,
- StructureNotifyMask | ExposureMask |
- KeyPressMask | KeyReleaseMask |
- ButtonPressMask | ButtonReleaseMask |
- PointerMotionMask | LeaveWindowMask);
+ int events = StructureNotifyMask | ExposureMask;
+ if (vo->opts->WinID > 0) {
+ XWindowAttributes attribs;
+ if (XGetWindowAttributes(x11->display, vo->opts->WinID, &attribs))
+ events |= attribs.your_event_mask;
+ } else {
+ events |= KeyPressMask | KeyReleaseMask | ButtonPressMask |
+ ButtonReleaseMask | PointerMotionMask | LeaveWindowMask;
+ }
+ vo_x11_selectinput_witherr(vo, x11->display, x11->window, events);
XMapWindow(x11->display, x11->window);
}