summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-04 03:57:50 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-01-25 17:00:09 +0900
commitfffd7e7a3a2b57eb13fda334a742ba48d0e0b612 (patch)
treec69a243d8c2a792cf3d54f3722b06ae45ab1650a
parent59781d3cb3212fd832ae1a8c3a5b3b465b9fcadb (diff)
downloadmpv-fffd7e7a3a2b57eb13fda334a742ba48d0e0b612.tar.bz2
mpv-fffd7e7a3a2b57eb13fda334a742ba48d0e0b612.tar.xz
x11: make display-names property stricter
Returning the property before the window is mapped could lead to confusing behavior, and in particular strange differences between vo_vdpau and vo_opengl. (vo_opengl creates the window right at the start, while vdpau waits until the first reconfigure event.) It might even be possible that for vo_opengl random results were returned, because the hidden window can have different placement than the actual, final one on initial video reconfig. Fix this by returning the property only if the window is considered mapped. command.c handles this case specifically, and makes the property unavailable, instead of returning an empty list.
-rw-r--r--video/out/x11_common.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 1fc251f0c8..7322c0a011 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -1593,7 +1593,7 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg)
return VO_TRUE;
}
case VOCTRL_GET_WIN_STATE: {
- if (!x11->window)
+ if (!x11->pseudo_mapped)
return VO_FALSE;
int num_elems;
long *elems = x11_get_property(x11, x11->window, XA(x11, _NET_WM_STATE),
@@ -1609,6 +1609,8 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg)
return VO_TRUE;
}
case VOCTRL_GET_DISPLAY_NAMES: {
+ if (!x11->pseudo_mapped)
+ return VO_FALSE;
char **names = NULL;
int displays_spanned = 0;
for (int n = 0; n < x11->num_displays; n++) {