Fwd: [GDK] generic patch
- From: "Tor Lillqvist" <tml iki fi>
- To: gtk-devel-list gnome org
- Subject: Fwd: [GDK] generic patch
- Date: Tue, 28 Oct 2008 04:42:06 +0300
---------- Forwarded message ----------
From: Steve Lhomme <slhomme corecodec com>
Date: 2008/10/28
Subject: [GDK] generic patch
To: Tor Lillqvist <tml iki fi>, Tor Lillqvist <tml novell com>
Hi (again) Tor,
While working on GDK I found a nasty bug. I attach a patch to fix it.
In my code I use gdk_add_client_message_filter() to get some custom
events that I want to receive in the UI thread. The problem is that
deep down in GDK, it use GdkClientFilter and GdkEventFilter. They are
both pased to apply_filters where it's assumed to be a GdkEventFilter,
but this is not the case with GdkClientFilter... Plus the structures
are not "compatible" (ie you can use a GdkClientFilter where a
GdkEventFilter is expected). The patch fixes that. And so GDK doesn't
call the callback pointed by my data...
Please forward to the relevant people to fix this (either with my
patch or something else). The bug exists on Win32, Linux and DirectFB.
Steve
diff -pruN ./directfb/gdkevents-directfb.c
\Software\used\gtk\src-tar\gtk+\gdk/directfb/gdkevents-directfb.c
--- ./directfb/gdkevents-directfb.c Mon Oct 27 17:34:04 2008
+++ \Software\used\gtk\src-tar\gtk+\gdk/directfb/gdkevents-directfb.c
Thu Sep 18 22:44:41 2008
@@ -901,8 +901,8 @@ gdk_display_add_client_message_filter (G
GdkClientFilter *filter = g_new (GdkClientFilter, 1);
filter->type = message_type;
- filter->event.function = func;
- filter->event.data = data;
+ filter->function = func;
+ filter->data = data;
client_filters = g_list_append (client_filters, filter);
}
diff -pruN ./gdkinternals.h \Software\used\gtk\src-tar\gtk+\gdk/gdkinternals.h
--- ./gdkinternals.h Mon Oct 27 17:25:34 2008
+++ \Software\used\gtk\src-tar\gtk+\gdk/gdkinternals.h Thu Sep 18 22:44:44 2008
@@ -65,8 +65,9 @@ struct _GdkEventFilter {
};
struct _GdkClientFilter {
- struct _GdkEventFilter event;
GdkAtom type;
+ GdkFilterFunc function;
+ gpointer data;
};
typedef enum {
diff -pruN ./win32/gdkevents-win32.c
\Software\used\gtk\src-tar\gtk+\gdk/win32/gdkevents-win32.c
--- ./win32/gdkevents-win32.c Mon Oct 27 17:26:50 2008
+++ \Software\used\gtk\src-tar\gtk+\gdk/win32/gdkevents-win32.c Thu
Sep 18 22:44:43 2008
@@ -820,8 +820,8 @@ gdk_add_client_message_filter (GdkAtom
GdkClientFilter *filter = g_new (GdkClientFilter, 1);
filter->type = message_type;
- filter->event.function = func;
- filter->event.data = data;
+ filter->function = func;
+ filter->data = data;
client_filters = g_list_append (client_filters, filter);
}
diff -pruN ./x11/gdkevents-x11.c
\Software\used\gtk\src-tar\gtk+\gdk/x11/gdkevents-x11.c
--- ./x11/gdkevents-x11.c Mon Oct 27 17:34:09 2008
+++ \Software\used\gtk\src-tar\gtk+\gdk/x11/gdkevents-x11.c Thu
Sep 18 22:44:44 2008
@@ -380,8 +380,8 @@ gdk_display_add_client_message_filter (G
filter = g_new (GdkClientFilter, 1);
filter->type = message_type;
- filter->event.function = func;
- filter->event.data = data;
+ filter->function = func;
+ filter->data = data;
GDK_DISPLAY_X11(display)->client_filters =
g_list_append (GDK_DISPLAY_X11 (display)->client_filters,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]