[mutter/wip/xinput2r: 5/66] display: Get the right window/time for input events
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/xinput2r: 5/66] display: Get the right window/time for input events
- Date: Thu, 18 Oct 2012 21:53:18 +0000 (UTC)
commit 044df0299833c80f7fbfb49e89c308175625c027
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Jun 8 10:44:34 2011 +0200
display: Get the right window/time for input events
src/core/display.c | 34 +++++++---------------------------
1 files changed, 7 insertions(+), 27 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index ac7af27..0349a72 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -2852,15 +2852,11 @@ static Window
event_get_modified_window (MetaDisplay *display,
XEvent *event)
{
+ if (meta_input_event_get_type (display, event, NULL))
+ return meta_input_event_get_window (display, event);
+
switch (event->type)
{
- case KeyPress:
- case KeyRelease:
- case ButtonPress:
- case ButtonRelease:
- case MotionNotify:
- case FocusIn:
- case FocusOut:
case KeymapNotify:
case Expose:
case GraphicsExpose:
@@ -2873,8 +2869,6 @@ event_get_modified_window (MetaDisplay *display,
case SelectionNotify:
case ColormapNotify:
case ClientMessage:
- case EnterNotify:
- case LeaveNotify:
return event->xany.window;
case CreateNotify:
@@ -2931,19 +2925,11 @@ static guint32
event_get_time (MetaDisplay *display,
XEvent *event)
{
+ if (meta_input_event_get_type (display, event, NULL))
+ return meta_input_event_get_time (display, event);
+
switch (event->type)
{
- case KeyPress:
- case KeyRelease:
- return event->xkey.time;
-
- case ButtonPress:
- case ButtonRelease:
- return event->xbutton.time;
-
- case MotionNotify:
- return event->xmotion.time;
-
case PropertyNotify:
return event->xproperty.time;
@@ -2952,13 +2938,7 @@ event_get_time (MetaDisplay *display,
case SelectionNotify:
return event->xselection.time;
- case EnterNotify:
- case LeaveNotify:
- return event->xcrossing.time;
-
- case FocusIn:
- case FocusOut:
- case KeymapNotify:
+ case KeymapNotify:
case Expose:
case GraphicsExpose:
case NoExpose:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]