After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 740838 - Windows are not moved on primary screen, when secondary screen disconnected
Windows are not moved on primary screen, when secondary screen disconnected
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: window-management
3.14.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
docking-station
Depends on:
Blocks:
 
 
Reported: 2014-11-28 08:43 UTC by Vít Ondruch
Modified: 2014-12-11 12:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
monitor-manager-xrandr: Set CRTC config even if it might be redundant (3.47 KB, patch)
2014-12-10 18:15 UTC, Rui Matos
committed Details | Review

Description Vít Ondruch 2014-11-28 08:43:04 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
Comment 1 Rui Matos 2014-12-08 14:50:05 UTC
Is this on an intel GPU ?
Comment 2 Vít Ondruch 2014-12-08 22:09:30 UTC
Yes, it is.
Comment 3 Rui Matos 2014-12-10 18:11:36 UTC
Ok, not intel specific as my initial testing suggested. Patches incoming
Comment 4 Rui Matos 2014-12-10 18:15:26 UTC
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
Comment 5 Jasper St. Pierre (not reading bugmail) 2014-12-10 18:20:07 UTC
Review of attachment 292472 [details] [review]:

OK.
Comment 6 Rui Matos 2014-12-11 12:41:48 UTC
Attachment 292472 [details] pushed as 25aa942 - monitor-manager-xrandr: Set CRTC config even if it might be redundant