gtk+ and randr

Ben Gamari ben at mw0.ath.cx
Mon Jul 21 15:43:51 PDT 2008


On Mon, 2008-07-21 at 09:54 -0400, Adam Jackson wrote:

> XRRGetScreenResources is an expensive call.  Always.  If gtk is calling
> it on every app startup they're absolutely insane.
> 
> > While I have run across a few discussions[2][3] on how to resolve this
> > issue, I haven't seen any definitive plans. Most of the proposals I've
> > seen from the gtk+/gnome people revolve around doing caching in the x
> > server. Is this a reasonable course of action from the perspective of
> > the x server?  Discuss.
> 
> Caching doesn't solve anything.  Caching just means you get two
> requests, one for "tell me a configuration you had some time in the
> past" and one for "tell me how you're configured right now", and you end
> up always calling the latter.

Someone really needs to tell the GTK+ folks that. Judging from some of
the documents I mentioned in my original email, they seem pretty
convinced that caching is the solution. I quote from [3] below,

        - X server work:
        
        	X server needs to poll for whether a monitor is plugged
                in. Whenever it detects a change, it should do an EDID query,
                and cache the resulting information. That way XRRGetScreenResources()
        	can be the speed of a normal roundtrip. It's desirable that 
        	normal client requests can still be processed during the EDID
                querying, but only a nice-to-have.
        
Even with this, they still want to call XRRGetScreenResources "on
startup and in response to events." Sounds like someone needs to set
them straight.

- Ben





More information about the xorg mailing list