Bug 265955

Summary: [PATCH] Can't switch back to laptop display when external display gets disconnected
Product: [Applications] systemsettings Reporter: Benni Hill <benni>
Component: kcm_randrAssignee: Gustavo Pichorim Boiko <gustavo.boiko>
Status: RESOLVED FIXED    
Severity: normal CC: hbock, lamarque, nico.schloemer
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 4.7.0
Attachments: patch for randrmonitor.cpp
added: disable disconnected outputs and enable a connected output on resume from suspend

Description Benni Hill 2011-02-10 02:25:15 UTC
Created attachment 57073 [details]
patch for randrmonitor.cpp

Version:           unspecified (using KDE 4.6.0) 
OS:                Linux

This is a patch to the kded_randrmonitor service that solves the below mentioned problem.
If only one output is connected and the user tries to switch the display it makes sure the connected output gets activated and deactivates all disconnected output afterwards.

Reproducible: Always

Steps to Reproduce:
1. Connect an external display to your laptop and use your latop's hotkey (e.g. Fn+F6) to active it and deactivate your laptop's display.
2. Disconnect the external display
3. Try to switch back to internal display with your keyboard

Actual Results:  
Nothing happens
Comment 1 Benni Hill 2011-02-12 01:39:08 UTC
Created attachment 57171 [details]
added: disable disconnected outputs and enable a connected output on resume from suspend

I improved my patch.
Now it also automatically deactivates all disconnected outputs on resume from suspend and switches to a connected monitor if needed. This should fix e.g. Bug #257642.
Please test.

I also want to propose to change the behaviour of RandROutput::isActive() to just check for a valid crtc, because a output can be "active" without beeing connected.
Comment 2 Benni Hill 2011-02-22 14:26:45 UTC
Patch submitted to reviewboard, and improved:
http://svn.reviewboard.kde.org/r/6513/
Comment 3 Lamarque V. Souza 2011-06-06 00:10:29 UTC
Has this patch been applied to KDE's repository?
Comment 4 Lamarque V. Souza 2011-07-11 15:54:47 UTC
Git commit 505c9e0cdc5a6daddd300bd756278b8a9c0fa5cf by Lamarque V. Souza.
Committed on 11/07/2011 at 17:52.
Pushed by lvsouza into branch 'master'.

Fix can't switch back to laptop display when external display gets
disconnected.

REVIEW: 6513
BUG: 257642
BUG: 265955
FIXED-IN: 4.7.0

M  +75   -14   kcontrol/randr/module/randrmonitor.cpp     
M  +10   -0    kcontrol/randr/module/randrmonitor.h     

http://commits.kde.org/kde-workspace/505c9e0cdc5a6daddd300bd756278b8a9c0fa5cf
Comment 5 Lamarque V. Souza 2011-07-11 15:59:23 UTC
Git commit aba27511815aacec5c9769cd7a3a1fc1fa2cf80e by Lamarque V. Souza.
Committed on 11/07/2011 at 17:52.
Pushed by lvsouza into branch 'KDE/4.7'.

Fix can't switch back to laptop display when external display gets
disconnected.

REVIEW: 6513
BUG: 257642
BUG: 265955
FIXED-IN: 4.7.0
(cherry picked from commit 505c9e0cdc5a6daddd300bd756278b8a9c0fa5cf)

M  +75   -14   kcontrol/randr/module/randrmonitor.cpp     
M  +10   -0    kcontrol/randr/module/randrmonitor.h     

http://commits.kde.org/kde-workspace/aba27511815aacec5c9769cd7a3a1fc1fa2cf80e
Comment 6 Myriam Schweingruber 2012-06-20 08:04:24 UTC
*** Bug 225979 has been marked as a duplicate of this bug. ***