[mutter/wip/multitouch: 5/73] display: Get the right window/time for input events
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/multitouch: 5/73] display: Get the right window/time for input events
- Date: Mon, 31 Oct 2011 00:17:04 +0000 (UTC)
commit 08f06ba012758766d1f824f6d326fd370e45b0a3
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 f95ccb2..5cf778f 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -2663,15 +2663,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:
@@ -2684,8 +2680,6 @@ event_get_modified_window (MetaDisplay *display,
case SelectionNotify:
case ColormapNotify:
case ClientMessage:
- case EnterNotify:
- case LeaveNotify:
return event->xany.window;
case CreateNotify:
@@ -2742,19 +2736,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;
@@ -2763,13 +2749,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]