diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c index 8705a3d1d..cc94e3ecc 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; }