randr: Use XRRGetScreenResourcesCurrent (rhbz#888821)
commit407a184050778d2240c5bb50659532ca34318fa3
authorHans de Goede <hdegoede@redhat.com>
Mon, 7 Jan 2013 13:58:45 +0000 (7 14:58 +0100)
committerHans de Goede <hdegoede@redhat.com>
Mon, 7 Jan 2013 20:44:26 +0000 (7 21:44 +0100)
tree96f19c63fbf3a839db044d04d1019ba61a6e5d1f
parent47ebbb21909ac0b36a31d335502fe83a410939dd
randr: Use XRRGetScreenResourcesCurrent (rhbz#888821)

Using XRRGetScreenResources, causes the X-server to actively check for
new monitors, which generates Xrandr events even if nothing is changed, which
causes gnome-setting-manager to muck with the settings, racing with the
agent doing the same.

XRRGetScreenResourcesCurrent OTOH simply returns the last known settings
without any polling of the hardware and matching events being involved.

So use XRRGetScreenResourcesCurrent instead of XRRGetScreenResources, with
one exception. When the number of monitors is changed, so some outputs are
enabled or disabled, then the hardware polling is necessary to properly
reflect the connected / disconnected state in xrandr.

This requires Xrandr >= 1.3, note that since 0.12.0 we already depended
on >= 1.2 anyways, this patch raises the requirement to 1.3 and makes
it explict.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ChangeLog
configure.ac
src/vdagent-x11-randr.c