[mutter/wip/carlosg/picking-fixes: 2/4] clutter: Remove reentrancy checks at emit_event_chain()




commit 40eaa37739706f298f4f9595920f7d9315f76323
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Dec 28 17:03:12 2020 +0100

    clutter: Remove reentrancy checks at emit_event_chain()
    
    When using alt-tab to switch between windows, on a key handler we
    undo the compositor grab, which triggers a repick, which generates
    crossing events, which are handled in place, and trigger these
    reentrancy checks.
    
    On one hand, we do intend these crossings to take effect in place,
    rather than being queued (possibly after a number of already queued
    events). On the other hand, we now outright discourage generating
    events from random places (and hope to make it just not possible,
    eventually) thus we can afford not to protect against reentrancy
    caused by API misuse.
    
    So just drop these checks, and let these crossing events be
    properly handled.

 clutter/clutter/clutter-main.c | 13 -------------
 1 file changed, 13 deletions(-)
---
diff --git a/clutter/clutter/clutter-main.c b/clutter/clutter/clutter-main.c
index c2d31b4dd8..c1fc47e57e 100644
--- a/clutter/clutter/clutter-main.c
+++ b/clutter/clutter/clutter-main.c
@@ -1394,26 +1394,13 @@ event_click_count_generate (ClutterEvent *event)
 static inline void
 emit_event_chain (ClutterEvent *event)
 {
-  static gboolean lock = FALSE;
-
   if (event->any.source == NULL)
     {
       CLUTTER_NOTE (EVENT, "No source set, discarding event");
       return;
     }
 
-  /* reentrancy check */
-  if (lock != FALSE)
-    {
-      g_warning ("Tried emitting event during event delivery, bailing out.");
-      return;
-    }
-
-  lock = TRUE;
-
   _clutter_actor_handle_event (event->any.source, event);
-
-  lock = FALSE;
 }
 
 /*


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