[gtk+/xi2: 1084/1239] GdkEventSource: Pass an allocated event to filters.
- From: Carlos Garnacho <carlosg src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/xi2: 1084/1239] GdkEventSource: Pass an allocated event to filters.
- Date: Tue, 29 Sep 2009 10:55:53 +0000 (UTC)
commit 65454c149f13247e566537243e73e8aadad8433f
Author: Carlos Garnacho <carlos gnome org>
Date: Mon Sep 7 00:12:50 2009 +0200
GdkEventSource: Pass an allocated event to filters.
gdk/x11/gdkeventsource.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/gdk/x11/gdkeventsource.c b/gdk/x11/gdkeventsource.c
index c37ca34..d521807 100644
--- a/gdk/x11/gdkeventsource.c
+++ b/gdk/x11/gdkeventsource.c
@@ -90,7 +90,7 @@ static GdkEvent *
gdk_event_source_translate_event (GdkEventSource *event_source,
XEvent *xevent)
{
- GdkEvent *event = NULL;
+ GdkEvent *event = gdk_event_new (GDK_NOTHING);
GList *list = event_source->translators;
GdkFilterReturn result;
GdkWindow *filter_window;
@@ -104,7 +104,10 @@ gdk_event_source_translate_event (GdkEventSource *event_source,
_gdk_default_filters);
if (result == GDK_FILTER_REMOVE)
- return NULL;
+ {
+ gdk_event_free (event);
+ return NULL;
+ }
else if (result == GDK_FILTER_TRANSLATE)
return event;
}
@@ -127,12 +130,18 @@ gdk_event_source_translate_event (GdkEventSource *event_source,
g_object_unref (filter_window);
if (result == GDK_FILTER_REMOVE)
- return NULL;
+ {
+ gdk_event_free (event);
+ return NULL;
+ }
else if (result == GDK_FILTER_TRANSLATE)
return event;
}
}
+ gdk_event_free (event);
+ event = NULL;
+
while (list && !event)
{
GdkEventTranslator *translator = list->data;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]