[mutter/wip/wayland-clutter-events-2: 9/23] display: Add a quick out path to handle_xevent



commit 87354bdac610d837038fbd0886410681bb4b7e78
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Oct 3 16:12:34 2013 -0400

    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.

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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]