[gtk/wip/otte/dnd: 11/22] main: Don't synthesize crossing events when nothing changed



commit a12e563cd2d5d33a628f1e825dcbefd6423ca11e
Author: Benjamin Otte <otte redhat com>
Date:   Sat Feb 22 04:27:06 2020 +0100

    main: Don't synthesize crossing events when nothing changed
    
    This was especially bad because it was confusing the event controllers
    so much, they'd emit leave + enter events every time the mouse moved.

 gtk/gtkmain.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 98bb83dd22..01e2f246cc 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1321,6 +1321,9 @@ gtk_synthesize_crossing_events (GtkRoot         *toplevel,
   GtkWidget *prev;
   gboolean seen_ancestor;
 
+  if (old_target == new_target)
+    return;
+
   if (old_target && new_target)
     ancestor = gtk_widget_common_ancestor (old_target, new_target);
   else


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