clutter/Call-backend-handle_event-from-clutter_x11_handle_ev.patch
2010-05-03 10:17:51 +00:00

54 lines
2.1 KiB
Diff

From 0db0c1925b691d195fd779ef6e6d851d2135d790 Mon Sep 17 00:00:00 2001
From: Owen W. Taylor <otaylor@fishsoup.net>
Date: Fri, 30 Apr 2010 14:50:11 -0400
Subject: [PATCH 2/3] Call backend handle_event from clutter_x11_handle_event()
Whether events come from the main loop source or from
clutter_x11_handle_event(), we need to feed them to the backend
virtual handle_event function. This fixes problems with clients
using clutter_x11_handle_event() hanging because
GLXBufferSwapComplete events aren't received.
http://bugzilla.openedhand.com/show_bug.cgi?id=2101
---
clutter/x11/clutter-event-x11.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/clutter/x11/clutter-event-x11.c b/clutter/x11/clutter-event-x11.c
index 0d8c08d..20a77fd 100644
--- a/clutter/x11/clutter-event-x11.c
+++ b/clutter/x11/clutter-event-x11.c
@@ -1048,13 +1048,14 @@ ClutterX11FilterReturn
clutter_x11_handle_event (XEvent *xevent)
{
ClutterBackend *backend;
+ ClutterBackendX11Class *backend_x11_class;
ClutterEvent *event;
ClutterMainContext *clutter_context;
ClutterX11FilterReturn result;
gint spin = 1;
/* The return values here are someone approximate; we return
- * CLUTTER_X11_FILTER_REMOVE if and only if a clutter event is
+ * CLUTTER_X11_FILTER_REMOVE if a clutter event is
* generated for the event. This mostly, but not entirely,
* corresponds to whether other event processing should be
* excluded. As long as the stage window is not shared with another
@@ -1068,6 +1069,13 @@ clutter_x11_handle_event (XEvent *xevent)
clutter_context = _clutter_context_get_default ();
backend = clutter_context->backend;
+ backend_x11_class = CLUTTER_BACKEND_X11_GET_CLASS (backend);
+
+ /* If the backend just observed the event and didn't want it
+ * removed it could return FALSE, so assume that a TRUE return
+ * means that our caller should also do no further processing. */
+ if (backend_x11_class->handle_event (CLUTTER_BACKEND_X11(backend), xevent))
+ return CLUTTER_X11_FILTER_REMOVE;
event = clutter_event_new (CLUTTER_NOTHING);
--
1.7.0.1