Hi all, There is a some kinf of a "race condition" on gtk+-2.0 that prevents an application linked with gtk+-2.0 to receive xsettings. This is because xsettings is already implemented in gtk. That prevents a gtk+-2.0 application from using xsettings for its own use. The patch is fairly simple : In gdkevents-x11.c, in the function gdk_xsettings_client_event_filter(), it should not return GDK_FILTER_REMOVE in case xsettings_client_process_event() returns true, and give a chance to user define filters to catch the event too. On the other hand, the application should do the same otherwise, gtk maight not be able to catch the event either. Without this patch, I don't see how an application can process xsettings messages as they are catched internally by gtk. Here come the patch, let me know if it's going to be applied in a near future (otherwise, I'll have to avoid using xsettings because that won't work) : --- gtk+-2.0.6/gdk/x11/gdkevents-x11.c Fri Jun 14 16:31:39 2002 +++ gtk+-2.0.6-modified/gdk/x11/gdkevents-x11.c Mon Aug 26 22:27:55 2002 @@ -2207,10 +2207,8 @@ GdkEvent *event, gpointer data) { - if (xsettings_client_process_event (xsettings_client, (XEvent *)xevent)) - return GDK_FILTER_REMOVE; - else - return GDK_FILTER_CONTINUE; + xsettings_client_process_event (xsettings_client, (XEvent *)xevent); + return GDK_FILTER_CONTINUE; } static void Thanks in advance, Cheers, Olivier.
Message: 3 Subject: gtk+-2.0 and xsettings protocol From: Olivier Fourdan <fourdan xfce org> To: gtk-app-devel-list gnome org Date: 26 Aug 2002 09:42:20 +0200 Hi all, I have a problem with xsettings sample implementation from Owen with gtk+-2.0 While xsettings-0.1 (available from http://freedesktop.org) compiles and works fine with gtk+-1.2, it compiles with gtk+-2.0 but doesn't work so well. What happens with gtk+-2.0 is that the client sometimes connects to the manager, but not always. I suspect some kind of race condition, somewhere, since gtk+-2.0 itself uses xsettings internally. So, my questions : 1) Does the sample xsettings implementation is supposed to work with gtk+-2.0) ? 2) Is there any simple way to access xsettings values, install callbacks, etc. from a gtk+-2.0 application w/out reimplementing the xsetting protocol (ie using gtk+-2.0 implementation) ?
-- Olivier <fourdan xfce org> http://www.xfce.org ----------------------------------------------------------------------- XFce is a lightweight desktop environment for various *NIX systems. Designed for productivity, it loads and executes applications fast, while conserving system resources. XFce is all free software, released under GNU General Public License. Available from http://www.xfce.org
Attachment:
gtk-2.0.6-xsettings.patch
Description: Text document