randr: do not set crtc mode to NULL when changing resolution
commit918333e9adc8945a6a00c4d2ce19e2ce7f3a7be4
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 22 Nov 2012 14:55:10 +0000 (22 16:55 +0200)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 26 Nov 2012 11:28:20 +0000 (26 12:28 +0100)
tree197a4572e501a49b6e79603b0b27d9dc7ca46a86
parent5b84b6cfc0dcfca4bdc75ff328d812c53f67c1cf
randr: do not set crtc mode to NULL when changing resolution

The agent creates a unique mode vdagent-N per output, that is deleted
when the custom resolution is changed. In order to be deleted, it
can't be the current active crtc config.

Now, the vdagent just sets the mode to NULL, but that causes a change
of resolution probably due to gnome-settings-daemon (in RHEL6, it
switches to max resultion 2560x1600 before switching back to custom
resolution).

We can avoid deleting current mode by creating a different mode,
switching to it, and then deleting the previous mode. Also, we can
ignore some Create/Delete races with other XRandR clients that may
modify the mode simultaneously. This shouldn't be fatal, as long as
the rest of the resolution switching can take place.
src/vdagent-x11-randr.c