GNOME Bugzilla – Bug 740838
Windows are not moved on primary screen, when secondary screen disconnected
Last modified: 2014-12-11 12:41:55 UTC
When I remove my LP from docking station, where I am using secondary monitor, the application windows which were on the secondary monitor are left on their original place, hence they are effectively unavailable. They are not show in expose, it is quite tricky to move them on the primary (and only available screen), they are more or less lost. This never happened with older versions of Gnome. $ rpm -q gnome-shell gnome-shell-3.14.2-1.fc21.x86_64
Is this on an intel GPU ?
Yes, it is.
Ok, not intel specific as my initial testing suggested. Patches incoming
Created attachment 292472 [details] [review] monitor-manager-xrandr: Set CRTC config even if it might be redundant This optimization breaks our use of XRRScreenResources' timestamps to detect hotplugs in case one of the outputs is disconnected and the remaining ones don't need any mode, position or transform adjustments. In that scenario, when applying the new configuration, we resize the X screen but never call XRRSetCrtcConfig() and since XRRSetScreenSize() doesn't take a timestamp and the X server doesn't update its last set timestamp, when we next get a RRScreenChangeNotify and update ourselves, XRRScreenResources.timestamp will still be smaller than XRRScreenResources.configTimestamp which makes us think we're seeing a new hotplug. We just don't enter an endless loop because the screen size that we keep applying is always the same and the X server short-circuits and stops sending us RRScreenChangeNotifys. Always calling XRRSetCrtcConfig() ensures that the last set timestamp will be bigger than configTimestamp in the next event and thus making us trigger the monitors-changed signal properly. Note that the X server already does basically the same checks that we're removing here, so doing this shouldn't be a significant efficiency loss. See http://cgit.freedesktop.org/xorg/xserver/tree/randr/rrcrtc.c?h=server-1.16-branch#n539
Review of attachment 292472 [details] [review]: OK.
Attachment 292472 [details] pushed as 25aa942 - monitor-manager-xrandr: Set CRTC config even if it might be redundant