[gtk+/events-refactor: 1083/1085] GdkEventSource: Pass an allocated event to filters.
- From: Carlos Garnacho <carlosg src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/events-refactor: 1083/1085] GdkEventSource: Pass an allocated event to filters.
- Date: Tue, 29 Sep 2009 10:49:32 +0000 (UTC)
commit 4756f42fc01a50fb08572b994e9024af79d151e9
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 2002152..cb8f224 100644
--- a/gdk/x11/gdkeventsource.c
+++ b/gdk/x11/gdkeventsource.c
@@ -91,7 +91,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;
@@ -105,7 +105,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;
}
@@ -128,12 +131,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]