Comment 3 for bug 933626

Revision history for this message
Steve Langasek (vorlon) wrote :

Thanks for the patch! some feedback:

- the check for x11-display matches all sessions including console sessions, because x11-display is always set. We need to specifically check for a non-empty value here.
- the rotatescreen.sh script specifically assumes that getXconsole() can be applied once for each value of $displaynum, not just the currently active session. This is already broken and we should probably clean it up.
- sleep.sh, screenblank.sh and lid.sh assume that they can use getXuser() to get the user for *each* X display so that they can lock the screen (e.g., before suspending). This is important to preserve, since there may indeed be multiple X sessions running simultaneously (guest sessions, etc). This means we also need to be able to match on non-active sessions.
- the && unix_user in the check returns false if root is logged in to an X session. While this is discouraged and unlikely, we don't really want to fail to handle such sessions. Fixed by omitting this part of the check.
- the $user variable set by getXuser is used elsewhere as the argument to su, but the current check returns a numeric uid which doesn't work. We need to translate this to a username to retain compatibility.

I've adjusted the patch accordingly and committed it to the bzr repo. Will upload this to precise shortly.