Re: Patch against gtk+2.0.6 to fix an issue with xsettings [WAS: Re: gtk+-2.0 and xsettings protocol]



Olivier Fourdan wrote:

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,
Is there any reason why you can't work with GTK 2.0's XSettings client? (the GtkSettings object). You can register new XSettings properties you are interested in with gtk_settings_install_property() (if it hasn't already been registered by gtk+), then use the standard g_object_get() API on the GtkSettings object to read values, and listen on the "notify::propertyname" signal to get notification when the setting changes.

James.

--
Email: james daa com au              | Linux.conf.au   http://linux.conf.au/
WWW: http://www.daa.com.au/~james/ | Jan 22-25 Perth, Western Australia.






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]