XRRGetScreenResources() too slow
hadess at hadess.net
Fri May 9 10:39:24 PDT 2008
Following discussions about HAL/DeviceKit, people pretty much agreed
that using the XBACKLIGHT property from XRandR should be the one way to
handle brightness in user-space.
After a few fixed in gnome-power-manager in trunk, we found that setting
the backlight was very slow:
The problem is that XRRGetScreenResources() is very slow because it
probes for outputs (such as the VGA output on my system).
Soeren already mentioned the problem in:
There's a couple of way of fixing this, this is I think the better one:
1) Have XRRGetScreenResources() only ever return cached data.
The server would notify applications when hardware that supports
notifications gets added, or when any hardware gets removed.
This means XRRGetScreenResources() would be fast, and every GTK+
application could track new outputs being plugged in without user
2) Make XRRGetScreenResources take another argument (or as a new
function), allowing specific applications to force probing outputs that
don't support notifications. This would be used by system-level
applications, such as the GNOME Display capplet. If any changes in the
display are made, applications would be notified by the server.
This means that people using hardware that supports notifications will
have their applications adjust automatically to changing outputs.
People using VGA outputs will have to use the display capplet to
forcefully probe for the new output.
More information about the xorg