[mutter/wip/barriers-try-2: 2/8] display: Add spew for XI2
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/barriers-try-2: 2/8] display: Add spew for XI2
- Date: Mon, 26 Nov 2012 01:40:09 +0000 (UTC)
commit 8ec35041cefafc9e9cff4c3c10bd9f03d29cbc03
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Nov 20 18:35:41 2012 -0500
display: Add spew for XI2
https://bugzilla.gnome.org/show_bug.cgi?id=688779
src/core/display.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 56 insertions(+), 1 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 769f2e4..9800446 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -3186,6 +3186,52 @@ alarm_state_to_string (XSyncAlarmState state)
#ifdef WITH_VERBOSE_MODE
static void
+meta_spew_xi2event (MetaDisplay *display,
+ XIEvent *xev,
+ const char **name_p,
+ char **extra_p)
+{
+ const char *name = NULL;
+ char *extra = NULL;
+
+ switch (xev->evtype)
+ {
+ case XI_Motion:
+ name = "XI_Motion";
+ break;
+ case XI_ButtonPress:
+ name = "XI_ButtonPress";
+ break;
+ case XI_ButtonRelease:
+ name = "XI_ButtonRelease";
+ break;
+ case XI_KeyPress:
+ name = "XI_KeyPress";
+ break;
+ case XI_KeyRelease:
+ name = "XI_KeyRelease";
+ break;
+ case XI_FocusIn:
+ name = "XI_FocusIn";
+ break;
+ case XI_FocusOut:
+ name = "XI_FocusOut";
+ break;
+ case XI_Enter:
+ name = "XI_Enter";
+ break;
+ case XI_Leave:
+ name = "XI_Leave";
+ break;
+ }
+
+ /* TODO: extra */
+
+ *name_p = name;
+ *extra_p = extra;
+}
+
+static void
meta_spew_event (MetaDisplay *display,
XEvent *event)
{
@@ -3205,6 +3251,14 @@ meta_spew_event (MetaDisplay *display,
if (event->type == (display->damage_event_base + XDamageNotify))
return;
+ if (event->type == GenericEvent &&
+ event->xcookie.extension == display->xinput2_opcode)
+ {
+ XIEvent *xev = (XIEvent *) event->xcookie.data;
+ meta_spew_xi2event (display, xev, &name, &extra);
+ goto spew;
+ }
+
switch (event->type)
{
case KeyPress:
@@ -3487,13 +3541,14 @@ meta_spew_event (MetaDisplay *display,
break;
}
+ spew:
screen = meta_display_screen_for_root (display, event->xany.window);
if (screen)
winname = g_strdup_printf ("root %d", screen->number);
else
winname = g_strdup_printf ("0x%lx", event->xany.window);
-
+
meta_topic (META_DEBUG_EVENTS,
"%s on %s%s %s %sserial %lu\n", name, winname,
extra ? ":" : "", extra ? extra : "",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]