[mutter] backend-x11: Fix our awful hack for crossing events, too
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] backend-x11: Fix our awful hack for crossing events, too
- Date: Wed, 24 Jun 2015 17:35:47 +0000 (UTC)
commit 2cbaa6660c039073aefdafa168e15b493db3bd8a
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed Jun 24 10:30:10 2015 -0700
backend-x11: Fix our awful hack for crossing events, too
For enter / leave events, which we use in the UI code, we need to make
sure that these coordinates are root-relative as well, otherwise the
cursor when entering frames might be incorrect.
src/backends/x11/meta-backend-x11.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c
index cf428e8..604281d 100644
--- a/src/backends/x11/meta-backend-x11.c
+++ b/src/backends/x11/meta-backend-x11.c
@@ -143,6 +143,8 @@ static void
translate_crossing_event (MetaBackendX11 *x11,
XIEnterEvent *enter_event)
{
+ MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
+
/* Throw out weird events generated by grabs. */
if (enter_event->mode == XINotifyGrab ||
enter_event->mode == XINotifyUngrab)
@@ -151,7 +153,15 @@ translate_crossing_event (MetaBackendX11 *x11,
return;
}
- enter_event->event = meta_backend_x11_get_xwindow (x11);
+ Window stage_window = meta_backend_x11_get_xwindow (x11);
+ if (enter_event->event != stage_window)
+ {
+ /* See above for the rationale for this... */
+ g_assert (priv->mode == META_BACKEND_X11_MODE_COMPOSITOR);
+ enter_event->event = meta_backend_x11_get_xwindow (x11);
+ enter_event->event_x = enter_event->root_x;
+ enter_event->event_y = enter_event->root_y;
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]