[mutter/wip/wayland-clutter-events-2: 4/19] display: Move barrier event processing to barrier.c
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/wayland-clutter-events-2: 4/19] display: Move barrier event processing to barrier.c
- Date: Sat, 5 Oct 2013 14:15:09 +0000 (UTC)
commit 2015686e342343d200f6465e4955fca932d2ac91
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Oct 3 15:22:26 2013 -0400
display: Move barrier event processing to barrier.c
This puts all the code that's easily ported to Clutter events in one giant
switch statement, as Clutter doesn't translate barrier events.
src/core/barrier.c | 18 ++++++++++++++++--
src/core/display-private.h | 4 ++--
src/core/display.c | 15 ++++++++-------
3 files changed, 26 insertions(+), 11 deletions(-)
---
diff --git a/src/core/barrier.c b/src/core/barrier.c
index 643b26e..b869d2e 100644
--- a/src/core/barrier.c
+++ b/src/core/barrier.c
@@ -366,11 +366,25 @@ meta_barrier_fire_event (MetaBarrier *barrier,
}
gboolean
-meta_display_process_barrier_event (MetaDisplay *display,
- XIBarrierEvent *xev)
+meta_display_process_barrier_event (MetaDisplay *display,
+ XIEvent *event)
{
MetaBarrier *barrier;
+ XIBarrierEvent *xev;
+ if (event == NULL)
+ return FALSE;
+
+ switch (event->evtype)
+ {
+ case XI_BarrierHit:
+ case XI_BarrierLeave:
+ break;
+ default:
+ return FALSE;
+ }
+
+ xev = (XIBarrierEvent *) event;
barrier = g_hash_table_lookup (display->xids, &xev->barrier);
if (barrier != NULL)
{
diff --git a/src/core/display-private.h b/src/core/display-private.h
index d3427f8..eb7569d 100644
--- a/src/core/display-private.h
+++ b/src/core/display-private.h
@@ -486,8 +486,8 @@ gboolean meta_display_handle_xevent (MetaDisplay *display,
XEvent *event);
#ifdef HAVE_XI23
-gboolean meta_display_process_barrier_event (MetaDisplay *display,
- XIBarrierEvent *event);
+gboolean meta_display_process_barrier_event (MetaDisplay *display,
+ XIEvent *event);
#endif /* HAVE_XI23 */
void meta_display_set_input_focus_xwindow (MetaDisplay *display,
diff --git a/src/core/display.c b/src/core/display.c
index ac15d6d..e21980b 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -2406,6 +2406,14 @@ meta_display_handle_xevent (MetaDisplay *display,
}
#endif /* HAVE_SHAPE */
+#ifdef HAVE_XI23
+ if (meta_display_process_barrier_event (display, input_event))
+ {
+ filter_out_event = bypass_compositor = TRUE;
+ goto out;
+ }
+#endif /* HAVE_XI23 */
+
if (input_event != NULL)
{
XIDeviceEvent *device_event = (XIDeviceEvent *) input_event;
@@ -2761,13 +2769,6 @@ meta_display_handle_xevent (MetaDisplay *display,
}
break;
-#ifdef HAVE_XI23
- case XI_BarrierHit:
- case XI_BarrierLeave:
- if (meta_display_process_barrier_event (display, (XIBarrierEvent *) input_event))
- filter_out_event = bypass_compositor = TRUE;
- break;
-#endif /* HAVE_XI23 */
}
}
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]