Comment 4 for bug 591660

Revision history for this message
Jay Taoko (jaytaoko) wrote :

The patch:

--- clutter/x11/clutter-event-x11.c 2010-03-18 13:18:06.000000000 -0400
+++ clutter/x11/clutter-event-x11.c 2010-06-18 13:05:09.243912688 -0400
@@ -816,6 +816,22 @@
               goto out;
             }

+ if (g_getenv ("CLUTTER_CHECK_LEAVE_EVENTS"))
+ {
+ Window root_return;
+ gint x, y;
+ guint width, height, border, depth;
+
+ XGetGeometry (backend_x11->xdpy, xwindow, &root_return, &x, &y, &width, &height, &border, &depth);
+
+ if ((xevent->xcrossing.x >= x) && (xevent->xcrossing.x < x+width) && (xevent->xcrossing.y >= y) && (xevent->xcrossing.y < y+height))
+ {
+ CLUTTER_NOTE(EVENT, "Discarding Leave Event");
+ res = FALSE;
+ goto out;
+ }
+ }
+
           /* we know that we are leaving the stage here */
           _clutter_input_device_set_stage (device, NULL);
           CLUTTER_NOTE (EVENT, "Leaving the stage (time:%u)",