[mutter] Add meta_display_set_alarm_filter()
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] Add meta_display_set_alarm_filter()
- Date: Fri, 12 Sep 2014 17:19:16 +0000 (UTC)
commit 44ecb1c050ddec57eebca79a4ec21ee480e6254a
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Thu Sep 11 10:09:43 2014 -0400
Add meta_display_set_alarm_filter()
Add a private hook for the test framework to get XSyncAlarmEvent events -
this will be used to implement XSyncCounter based synchronization
so that the test framework can deterministically wait until Mutter
has seen actions performed by an X11 client.
https://bugzilla.gnome.org/show_bug.cgi?id=736505
src/core/display-private.h | 11 +++++++++++
src/core/display.c | 11 +++++++++++
src/x11/events.c | 8 ++++++++
3 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/src/core/display-private.h b/src/core/display-private.h
index e63d22c..59ce085 100644
--- a/src/core/display-private.h
+++ b/src/core/display-private.h
@@ -97,6 +97,10 @@ typedef enum {
META_EVENT_ROUTE_WINDOW_OP,
} MetaEventRoute;
+typedef gboolean (*MetaAlarmFilter) (MetaDisplay *display,
+ XSyncAlarmNotifyEvent *event,
+ gpointer data);
+
struct _MetaDisplay
{
GObject parent_instance;
@@ -256,6 +260,9 @@ struct _MetaDisplay
MetaGestureTracker *gesture_tracker;
ClutterEventSequence *pointer_emulating_sequence;
+ MetaAlarmFilter alarm_filter;
+ gpointer alarm_filter_data;
+
int composite_event_base;
int composite_error_base;
int composite_major_version;
@@ -453,4 +460,8 @@ void meta_display_cancel_touch (MetaDisplay *display);
gboolean meta_display_windows_are_interactable (MetaDisplay *display);
+gboolean meta_display_set_alarm_filter (MetaDisplay *display,
+ MetaAlarmFilter filter,
+ gpointer data);
+
#endif
diff --git a/src/core/display.c b/src/core/display.c
index a6c5612..38630d6 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -2954,3 +2954,14 @@ meta_display_is_pointer_emulating_sequence (MetaDisplay *display,
return display->pointer_emulating_sequence == sequence;
}
+
+gboolean
+meta_display_set_alarm_filter (MetaDisplay *display,
+ MetaAlarmFilter filter,
+ gpointer data)
+{
+ g_return_if_fail (filter == NULL || display->alarm_filter == NULL);
+
+ display->alarm_filter = filter;
+ display->alarm_filter_data = data;
+}
diff --git a/src/x11/events.c b/src/x11/events.c
index 19fbcaa..97bd41f 100644
--- a/src/x11/events.c
+++ b/src/x11/events.c
@@ -1188,6 +1188,14 @@ handle_other_xevent (MetaDisplay *display,
meta_window_x11_update_sync_request_counter (alarm_window, new_counter_value);
bypass_gtk = TRUE; /* GTK doesn't want to see this really */
}
+ else
+ {
+ if (display->alarm_filter &&
+ display->alarm_filter (display,
+ (XSyncAlarmNotifyEvent*)event,
+ display->alarm_filter_data))
+ bypass_gtk = TRUE;
+ }
goto out;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]