[mutter] backend-x11: Also spoof Enter/Leave notifies as well



commit 7e7c8ecbd404858a144b21e087208061d0bb1907
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Jan 19 21:12:26 2015 -0800

    backend-x11: Also spoof Enter/Leave notifies as well
    
    So that we track when the user enters/exits the frame window
    appropriately. This fixes a rogue cursor appearing when the window
    doesn't define one.

 src/backends/x11/meta-backend-x11.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c
index 8705a3d..cc94e3e 100644
--- a/src/backends/x11/meta-backend-x11.c
+++ b/src/backends/x11/meta-backend-x11.c
@@ -129,6 +129,21 @@ translate_device_event (MetaBackendX11 *x11,
     }
 }
 
+static void
+translate_crossing_event (MetaBackendX11 *x11,
+                          XIEnterEvent   *enter_event)
+{
+  /* Throw out weird events generated by grabs. */
+  if (enter_event->mode == XINotifyGrab ||
+      enter_event->mode == XINotifyUngrab)
+    {
+      enter_event->event = None;
+      return;
+    }
+
+  enter_event->event = meta_backend_x11_get_xwindow (x11);
+}
+
 /* Clutter makes the assumption that there is only one X window
  * per stage, which is a valid assumption to make for a generic
  * application toolkit. As such, it will ignore any events sent
@@ -161,6 +176,10 @@ maybe_spoof_event_as_stage_event (MetaBackendX11 *x11,
         case XI_TouchEnd:
           translate_device_event (x11, (XIDeviceEvent *) input_event);
           break;
+        case XI_Enter:
+        case XI_Leave:
+          translate_crossing_event (x11, (XIEnterEvent *) input_event);
+          break;
         default:
           break;
         }


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