Bug 264702

Summary: [PATCH] Disabled outputs can't be saved properly
Product: [Applications] systemsettings Reporter: Alexey Chernov <4ernov>
Component: kcm_randrAssignee: Gustavo Pichorim Boiko <gustavo.boiko>
Status: RESOLVED FIXED    
Severity: normal CC: hbock
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Solves the problem with unsaved disabled outputs

Description Alexey Chernov 2011-01-29 03:01:19 UTC
Created attachment 56598 [details]
Solves the problem with unsaved disabled outputs

Version:           unspecified (using KDE 4.6.0) 
OS:                Linux

Outputs which were firstly enabled and then were disabled by user can't be stored to krandrrc properly due to cyclic dependency in RandROutput::slotDisable() method: it tries to void rect and refreshrate using RandROutput::proposeRect() and RandROutput::proposeRefreshRate() methods which in turn try to enable the output. So in RandROutput::save() it's treated as enabled and the fact that it's actually disabled isn't saved.
I removed unnecessary proposeRect() and proposeRefreshRate() calls from slotDisable() and also added to RandROutput::applyProposed() special case to save always if the output is disabled (as we don't have something like proposeActive var and I don't think it's necessary).

Reproducible: Always

Steps to Reproduce:
1. Enable one of the outputs. Apply the results. See that it was saved to ~/.kde/share/config/krandrrc
2. Disable it. Apply the results. See that settings on krandrrc weren't changed for the output.
Comment 1 Aaron J. Seigo 2011-02-04 08:24:23 UTC
Git commit 0040d4b70e2c4bc4c4fe4fb33cf0018d430a2205 by Aaron Seigo.
Committed on 04/02/11 at 08:16.
Pushed by aseigo into branch 'KDE/4.6'.

save disabled screens, don't enable by accident

based on a patch by Alexey Chernov
BUG:264702

M  +18   -9    kcontrol/randr/randroutput.cpp     

http://commits.kde.org/kde-workspace/0040d4b70e2c4bc4c4fe4fb33cf0018d430a2205
Comment 2 Aaron J. Seigo 2011-02-04 08:24:23 UTC
Git commit 39dd0dd2946cc864f884e32ad3dbb43055f56f12 by Aaron Seigo.
Committed on 04/02/11 at 08:16.
Pushed by aseigo into branch 'master'.

save disabled screens, don't enable by accident

based on a patch by Alexey Chernov
BUG:264702

M  +18   -9    kcontrol/randr/randroutput.cpp     

http://commits.kde.org/kde-workspace/39dd0dd2946cc864f884e32ad3dbb43055f56f12
Comment 3 Alexey Chernov 2011-02-04 10:38:49 UTC
Aaron, thank you very much for committing my patches!