Bug#372856: krandrtray does NOT correctly switch resolution on my setup
While trying to add xrandr support to Xvnc, I faced a bug in xrandr
implementation in XFree 4.x; maybe current Xorg also has it?
Bug is that xrandr stores the moment of last switch as 64-bit value. Then,
in 'get configuration' request it sends this time to client as 32-bit
value. In 'set configuration' request clents should return same value to
the server. Idea is to check situation when other client has changed
configuration since this client last read it.
Problem is with timestamp compare in implementation of 'set configuration'
request. It compares 64 bit values; before that, it converts 32 bit value
got from client to 64 bit value by guessing the 'nearest' 64bit value (see
ClentTimeToServerTime() routine).
In practice this may result in comparison failure because of difference in
higher word. This happens at least in two cases:
- if enough ime (about a month) passed since last configuration (or server
startup)
- [much more probable] if system time went backwards at some moment (ntp?
date -s?), X server manually increases higher word of it's server time to
avoid server time going backwards.
If this problem raises, nor xrandr -s, not krandrtray, nor any other xrandr
client is able to switch configuration until X server restarts.
Reply to: