mirror of
https://github.com/mpv-player/mpv
synced 2024-12-27 09:32:40 +00:00
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.
This commit is contained in:
parent
fc95678d8d
commit
a8df0bbf22
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user