mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 18:35:35 +00:00
gl/window/x11: handle_events() may be called before the window has been created
Fixes an XIO fatal error
This commit is contained in:
parent
cd2669fad1
commit
e2adfb8bf2
1 changed files with 16 additions and 7 deletions
|
@ -61,6 +61,8 @@ struct _GstGLWindowX11Private
|
||||||
|
|
||||||
gint preferred_width;
|
gint preferred_width;
|
||||||
gint preferred_height;
|
gint preferred_height;
|
||||||
|
|
||||||
|
gboolean handle_events;
|
||||||
};
|
};
|
||||||
|
|
||||||
guintptr gst_gl_window_x11_get_display (GstGLWindow * window);
|
guintptr gst_gl_window_x11_get_display (GstGLWindow * window);
|
||||||
|
@ -236,6 +238,9 @@ gst_gl_window_x11_create_window (GstGLWindowX11 * window_x11)
|
||||||
window_x11->visual_info->depth, InputOutput,
|
window_x11->visual_info->depth, InputOutput,
|
||||||
window_x11->visual_info->visual, mask, &win_attr);
|
window_x11->visual_info->visual, mask, &win_attr);
|
||||||
|
|
||||||
|
gst_gl_window_x11_handle_events (GST_GL_WINDOW (window_x11),
|
||||||
|
window_x11->priv->handle_events);
|
||||||
|
|
||||||
XSync (window_x11->device, FALSE);
|
XSync (window_x11->device, FALSE);
|
||||||
|
|
||||||
XSetWindowBackgroundPixmap (window_x11->device,
|
XSetWindowBackgroundPixmap (window_x11->device,
|
||||||
|
@ -490,6 +495,9 @@ gst_gl_window_x11_handle_events (GstGLWindow * window, gboolean handle_events)
|
||||||
|
|
||||||
window_x11 = GST_GL_WINDOW_X11 (window);
|
window_x11 = GST_GL_WINDOW_X11 (window);
|
||||||
|
|
||||||
|
window_x11->priv->handle_events = handle_events;
|
||||||
|
|
||||||
|
if (window_x11->internal_win_id) {
|
||||||
if (handle_events) {
|
if (handle_events) {
|
||||||
XSelectInput (window_x11->device, window_x11->internal_win_id,
|
XSelectInput (window_x11->device, window_x11->internal_win_id,
|
||||||
StructureNotifyMask | ExposureMask | VisibilityChangeMask |
|
StructureNotifyMask | ExposureMask | VisibilityChangeMask |
|
||||||
|
@ -498,6 +506,7 @@ gst_gl_window_x11_handle_events (GstGLWindow * window, gboolean handle_events)
|
||||||
XSelectInput (window_x11->device, window_x11->internal_win_id,
|
XSelectInput (window_x11->device, window_x11->internal_win_id,
|
||||||
StructureNotifyMask | ExposureMask | VisibilityChangeMask);
|
StructureNotifyMask | ExposureMask | VisibilityChangeMask);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
|
Loading…
Reference in a new issue