From a8df0bbf22ab05eb5ebd92f6dbb30abd7428120e Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 12 Jan 2015 12:15:27 +0100 Subject: x11: explicitly query map status when waiting for map event For some reason, mpv sometimes does not get a MapNotify event with GtkSocket embedding. This happens maybe 1 out of 10 times. I'm not sure how this can happen - it certainly shouldn't. Since I was not able to find the cause, and causes an apparent "deadlock", here's a lazy hack to fix the misbehavior. --- video/out/x11_common.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'video/out/x11_common.c') diff --git a/video/out/x11_common.c b/video/out/x11_common.c index af603b2ac8..f5a3f9e808 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -1356,6 +1356,12 @@ static void wait_until_mapped(struct vo *vo) if (!x11->pseudo_mapped) x11_send_ewmh_msg(x11, "_NET_REQUEST_FRAME_EXTENTS", (long[5]){0}); while (!x11->pseudo_mapped && x11->window) { + XWindowAttributes att; + XGetWindowAttributes(x11->display, x11->window, &att); + if (att.map_state != IsUnmapped) { + x11->pseudo_mapped = true; + break; + } XEvent unused; XPeekEvent(x11->display, &unused); vo_x11_check_events(vo); -- cgit v1.2.3