GNOME Bugzilla – Bug 552956
Should check composite extension version
Last modified: 2008-09-27 03:44:06 UTC
We rely on the change made last summer to the Composite extension. commit 1838412121d0bac8ce443d362e75439d58a93a4d Author: Keith Packard <keithp@neko.keithp.com> Date: Tue Jul 3 14:09:41 2007 -0700 Define new manual-redirect clipping semantics and bump version to 0.4. Manual-redirect windows no longer clip their parents, nor do they affect expose event computation. This makes it possible to create application-level composited windows which can be damaged by other window manipulations. So we should check for it. Otherwise people using apps that rely on gdk_display_supports_composite() will mysteriously get missing drawing on older X servers.
Created attachment 119019 [details] [review] Patch checking composite version
I was supposed to add this check when I first rolled the patch. Originally, I think, the idea was to complain loudly (g_warning) on the first attempt to call set_composite() that the user needed to upgrade their X server and then to allow compositing to be used anyway (since it's still slightly useful -- you can work around the expose issues by doing manual invalidation). I think there was a string freeze or something that got in the way of that at the time? I forget...
I don't see any reason to encourage developers to write a 3rd code path "half working composite", and AFAIK, the support for IncludeInferiors rendering was never added into cairo. Especially since anybody doing active development likely has a compliant X server now, a year and two xserver releases later and I think a simple check should suffice.
The IncludeInferiors support was added to cairo (http://gitweb.freedesktop.org/?p=cairo;a=commit;h=0c5d28a4e5ce5e4dd72c0f416ce5e960e92b808b) and turned on by default, but only for the _source_ of draw operations. I think at the time when I thought this was a good idea I was either using a patched cairo or making XRender calls for myself... either way, not something that non-insane people will want to do (which is pretty much exactly why I bugged Keith for the change). So probably you're right about this one. It might be worth it to change this message: g_warning ("gdk_window_set_composited called but " "compositing is not supported"); to note that, on X11, you need version 0.4. It's not really the right place to make note of this (since probably the user is actually wondering why gdk_display_supports_composite() returns FALSE), but at the same time, adding the warning to gdk_display_supports_composite() would cause inappropriate stderr spew. To be honest, though, probably not so many people are running these old X servers anymore, so who cares? :)
2008-09-26 Matthias Clasen <mclasen@redhat.com> Bug 552956 – Should check composite extension version * gdk/x11/gdkdisplay-x11.c: Check that the version of the composite extension is at least 0.4. Patch by Owen Taylor