mirror of
https://github.com/mpv-player/mpv
synced 2024-12-17 20:34:58 +00:00
x11: fix crash with --wid=0 and vo_xv/vo_x11
But seriously, don't use --wid=0, don't use vo_xv, and _especially_ don't use vo_x11. Fixes #1284.
This commit is contained in:
parent
4cdd346246
commit
c9fdf4308c
@ -1213,8 +1213,6 @@ static void vo_x11_create_window(struct vo *vo, XVisualInfo *vis,
|
||||
vis->depth, CopyFromParent, vis->visual, xswamask, &xswa);
|
||||
Atom protos[1] = {XA(x11, WM_DELETE_WINDOW)};
|
||||
XSetWMProtocols(x11->display, x11->window, protos, 1);
|
||||
x11->f_gc = XCreateGC(x11->display, x11->window, 0, 0);
|
||||
x11->vo_gc = XCreateGC(x11->display, x11->window, 0, NULL);
|
||||
XSetForeground(x11->display, x11->f_gc, 0);
|
||||
|
||||
if (x11->mouse_cursor_hidden) {
|
||||
@ -1351,6 +1349,11 @@ void vo_x11_config_vo_window(struct vo *vo, XVisualInfo *vis, int flags,
|
||||
x11->winrc = geo.win;
|
||||
}
|
||||
|
||||
if (!x11->f_gc && !x11->vo_gc) {
|
||||
x11->f_gc = XCreateGC(x11->display, x11->window, 0, 0);
|
||||
x11->vo_gc = XCreateGC(x11->display, x11->window, 0, NULL);
|
||||
}
|
||||
|
||||
if (flags & VOFLAG_HIDDEN)
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user