backend-x11: Make sure to not crash during initialization

Sometimes we can get a host event without having the display up and
running yet. Just don't pass it to the compositor in that case, since it
won't be possible for it to have any event that matters.
This commit is contained in:
Jasper St. Pierre 2014-07-27 16:14:46 +02:00
parent 817995d97f
commit 4b5a503cee

View File

@ -151,14 +151,20 @@ handle_host_xevent (MetaBackend *backend,
{ {
MetaBackendX11 *x11 = META_BACKEND_X11 (backend); MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11); MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
MetaDisplay *display = meta_get_display ();
MetaCompositor *compositor = display->compositor;
gboolean bypass_clutter = FALSE; gboolean bypass_clutter = FALSE;
XGetEventData (priv->xdisplay, &event->xcookie); XGetEventData (priv->xdisplay, &event->xcookie);
if (meta_plugin_manager_xevent_filter (compositor->plugin_mgr, event)) {
bypass_clutter = TRUE; MetaDisplay *display = meta_get_display ();
if (display)
{
MetaCompositor *compositor = display->compositor;
if (meta_plugin_manager_xevent_filter (compositor->plugin_mgr, event))
bypass_clutter = TRUE;
}
}
if (event->type == (priv->xsync_event_base + XSyncAlarmNotify)) if (event->type == (priv->xsync_event_base + XSyncAlarmNotify))
handle_alarm_notify (backend, event); handle_alarm_notify (backend, event);