display: Add a quick out path to handle_xevent

This makes the code flow more like the scheme we usually use, and allows
us to flatten out the method somewhat.
This commit is contained in:
Jasper St. Pierre 2013-10-03 16:12:34 -04:00
parent 429583ae8b
commit 64a848fcb7

View File

@ -2261,16 +2261,20 @@ meta_display_handle_xevent (MetaDisplay *display,
sn_display_process_event (display->sn_display, event); sn_display_process_event (display->sn_display, event);
#endif #endif
bypass_compositor = FALSE;
filter_out_event = FALSE;
/* Intercept XRandR events early and don't attempt any /* Intercept XRandR events early and don't attempt any
processing for them. We still let them through to Gdk though, processing for them. We still let them through to Gdk though,
so it can update its own internal state. so it can update its own internal state.
*/ */
monitor = meta_monitor_manager_get (); monitor = meta_monitor_manager_get ();
if (meta_monitor_manager_handle_xevent (monitor, event)) if (meta_monitor_manager_handle_xevent (monitor, event))
return FALSE; {
bypass_compositor = TRUE;
goto out;
}
bypass_compositor = FALSE;
filter_out_event = FALSE;
display->current_time = event_get_time (display, event); display->current_time = event_get_time (display, event);
display->monitor_cache_invalidated = TRUE; display->monitor_cache_invalidated = TRUE;
@ -2291,7 +2295,10 @@ meta_display_handle_xevent (MetaDisplay *display,
if (screen) if (screen)
{ {
if (meta_screen_handle_xevent (screen, event)) if (meta_screen_handle_xevent (screen, event))
return TRUE; {
bypass_compositor = filter_out_event = TRUE;
goto out;
}
} }
modified = event_get_modified_window (display, event); modified = event_get_modified_window (display, event);
@ -2368,6 +2375,8 @@ meta_display_handle_xevent (MetaDisplay *display,
} }
else else
meta_idle_monitor_handle_xevent_all (event); meta_idle_monitor_handle_xevent_all (event);
goto out;
} }
#endif /* HAVE_XSYNC */ #endif /* HAVE_XSYNC */
@ -2393,6 +2402,8 @@ meta_display_handle_xevent (MetaDisplay *display,
window ? window->desc : "(none)", window ? window->desc : "(none)",
frame_was_receiver); frame_was_receiver);
} }
goto out;
} }
#endif /* HAVE_SHAPE */ #endif /* HAVE_SHAPE */
@ -3207,6 +3218,7 @@ meta_display_handle_xevent (MetaDisplay *display,
} }
} }
out:
if (display->compositor && !bypass_compositor) if (display->compositor && !bypass_compositor)
{ {
if (meta_compositor_process_event (display->compositor, if (meta_compositor_process_event (display->compositor,