Bug 313303 - Wrong resolution set upon disabling extra screen
Summary: Wrong resolution set upon disabling extra screen
Status: RESOLVED FIXED
Alias: None
Product: KScreen
Classification: Plasma
Component: common (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Alex Fiestas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-15 14:46 UTC by Steven Franzen
Modified: 2013-02-12 15:02 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
xrandr --verbose output (8.53 KB, text/plain)
2013-01-16 12:59 UTC, Steven Franzen
Details
kscreen-console output (4.43 KB, text/plain)
2013-01-16 13:00 UTC, Steven Franzen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Franzen 2013-01-15 14:46:03 UTC
After toggling off a second monitor via the KScreen control module, the resolution of my laptop's internal screen is erroneously modified from its native resolution 1366x768 to 1280x768. The external monitor was set to 1280x1024. 

Reproducible: Always

Steps to reproduce:
1) Connect and enable a second screen in kscreen.
2) Toggle off the external screen and Apply settings.

Actual results:
Second screen switches off, resolution of the first screen is modified.

Expected results:
Screen switches off, leaving the other screen's settings unchanged.

Additional info: Fedora 17 x86_64, KDE 4.9.5, fglrx
Comment 1 Daniel Vrátil 2013-01-15 22:46:22 UTC
Can you provide output from "xrandr --verbose" and kscreen-console?
Comment 2 Steven Franzen 2013-01-16 12:59:48 UTC
Created attachment 76508 [details]
xrandr --verbose output
Comment 3 Steven Franzen 2013-01-16 13:00:24 UTC
Created attachment 76509 [details]
kscreen-console output
Comment 4 Lamarque V. Souza 2013-01-27 20:00:02 UTC
I also have this problem and it is not kscreen's fault, I can reproduce it using xrandr only.

Yesterday I tried to implement a workaround in kscreen but get stuck in how kscreen works. kscreen always saves any configuration change that comes from xrandr, including the wrong resolution change that this bug is about. I think kscreen should only save the configuration that the user explicitly chooses in the kcm. That would minimize this problem and allow us to add an workaround to reload the configuration when one output is added/removed.

Here I added a simple hack to kscreen to always set the current mode to 152 (1600x900) when xrandr tries to set it to 153 (1440x900), I cannot use 1440x900 anymore but that is a minor problem for me. Unfortunately it does not always work, maybe there is race codition between xrandr and kscreen changing the mode.

Another issue I have is that my application changes to my external monitor when I wanted to the stay in the primary output (my notebook's lcd). Do you know anything about that problem?
Comment 5 Alex Fiestas 2013-02-09 13:41:49 UTC
Can you try if this happens with xrandr --auto ?

@lamarque:  That's a KWin bug we have to fix.
Comment 6 Alex Fiestas 2013-02-09 13:43:12 UTC
Can you test with latest KScreen? according to what I see in the files you attached you are NOT affected by Lamarque's bug.

Thanks !
(In reply to comment #3)
> Created attachment 76509 [details]
> kscreen-console output
Comment 7 Steven Franzen 2013-02-12 13:51:11 UTC
Hmm... Either my original bug report was inaccurate or the latest master fixed something. I am unable reproduce the switch to the wrong resolution by simply disabling the second screen now. A wrong resolution still gets selected with the following steps:

1) Disable the second screen through the kscreen KCM.
2) In the Size & Orientation settings, the "Apply" button will have become active. Clicking it forces the internal screen to the wrong resolution, despite 1366x768 still being selected in the Size list.

The correct resolution can then only be restored through Size & Orientation settings, by selecting a different resolution, then 1366x768 again and applying. Doing the same in the kscreen settings does not work.

With xrandr --auto: 
If the second screen is already enabled: nothing happens.
If the second screen is disabled: second (external) screen is selected as primary, internal screen is cloned with resolution of second screen.
Comment 8 Steven Franzen 2013-02-12 14:07:35 UTC
(In reply to comment #7)
> A wrong resolution still gets selected [...]

I should clarify that this is not the same resolution as before, which was 1280x768. This time, it somehow gets set to 1366x930:

sigma ~/kde/kscreen/build $ xrandr --verbose
Screen 0: minimum 320 x 200, current 1366 x 930, maximum 4096 x 4096
LVDS connected 1366x768+0+162 (0x98) normal (normal left inverted right x axis y axis) 353mm x 198mm
Comment 9 Alex Fiestas 2013-02-12 15:02:10 UTC
Ok, this is now a new bug then, can you open a new one and assign it to the KCM?

We'll need different info, and this bug is too big already.

thanks !