Bug 315613 - kwin retains large resolution when disabling second screen
Summary: kwin retains large resolution when disabling second screen
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: 4.9.4
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-22 05:08 UTC by Ben Daines
Modified: 2021-12-07 04:36 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
xrandr before (1.19 KB, text/plain)
2013-02-22 12:22 UTC, Ben Daines
Details
xrandr disabled (1.16 KB, text/plain)
2013-02-22 12:23 UTC, Ben Daines
Details
xrandr disabled & disconnected (717 bytes, text/plain)
2013-02-22 12:23 UTC, Ben Daines
Details
xrandr -q after disabling DisplayPort-0 via xrandr (1.16 KB, text/plain)
2013-02-22 16:33 UTC, Ben Daines
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Daines 2013-02-22 05:08:33 UTC
If I have a second display connected with Kubuntu 12.10 and radeon driver and I disable the screen kwin seems to act as if my desktop is the full resolution of the two screens combined.  Kwin should realize that the second screen is gone and behave properly for my remaining display. 

Reproducible: Always

Steps to Reproduce:
1. run KDE 4.9.4 with radeon opensource driver and 2 displays 
2. disable second display
3. made Kwin display something
Actual Results:  
If I set the second display to clone the first before disabling it, this happens 
http://i.imgur.com/ynkCK83.png

if I just disable the second screen this happens, 
http://i.imgur.com/z5SpT9g.jpg
http://i.imgur.com/BBZOVJY.png

Expected Results:  
Kwin should render for the proper resolution. 

kubuntu 12.10
Radeon HD 6750 
KDE 4.9.4
radeon package version: 1:6.99.99~git20120913.8637d772-0ubuntu1
Comment 1 Martin Flöser 2013-02-22 06:56:07 UTC
how do you disable the screen? Through the configuration module? If yes, does the problem also occur if you disable the screen through xrandr directly?
Comment 2 Thomas Lübking 2013-02-22 11:17:11 UTC
in doubt, pleaSe just post the outputs of "xrandr -q" before and after disabling the screen.
Comment 3 Ben Daines 2013-02-22 12:19:57 UTC
I disable though system settings.
Comment 4 Ben Daines 2013-02-22 12:22:46 UTC
Created attachment 77506 [details]
xrandr before
Comment 5 Ben Daines 2013-02-22 12:23:07 UTC
Created attachment 77507 [details]
xrandr disabled
Comment 6 Ben Daines 2013-02-22 12:23:44 UTC
Created attachment 77508 [details]
xrandr disabled & disconnected

output when display has been disabled, and physically unplugged
Comment 7 Ben Daines 2013-02-22 12:24:19 UTC
"kwin --replace" clears things up
Comment 8 Thomas Lübking 2013-02-22 15:17:06 UTC
There's again this weird
current 1681 x 1052, maximum 16384 x 16384
                 ^^^       ^^
LVDS connected 1680x1050+0+0
                                 ^^      ^^

From the dualscreen state please run:

xrandr --output DisplayPort-0 --off

see what happes and check the screen resolution in "xrandr -q"

Next (from the correctly working single screen setup) run:

xrandr --output LVDS --mode 1440x900

(this will shrink your resolution, use "xrandr --output LVDS --mode 1680x1050" to return to the correct resolution)

and again see what happens (ie. "is the output correctly shrinked")

Reg. the screenshots:
- did you take them with ksnapshot?
- how does this actually look "on screen" (ie. is the output squeezed or capped?)
Comment 9 Ben Daines 2013-02-22 16:31:45 UTC
(In reply to comment #8)
> There's again this weird
> current 1681 x 1052, maximum 16384 x 16384
>                  ^^^       ^^
> LVDS connected 1680x1050+0+0
>                                  ^^      ^^
> 
> From the dualscreen state please run:
> 
> xrandr --output DisplayPort-0 --off
> 
> see what happes and check the screen resolution in "xrandr -q"

That worked as expected.  output attached.

> Next (from the correctly working single screen setup) run:
> 
> xrandr --output LVDS --mode 1440x900
> 
> (this will shrink your resolution, use "xrandr --output LVDS --mode
> 1680x1050" to return to the correct resolution)
> 
> and again see what happens (ie. "is the output correctly shrinked")

Output shrank, and came back.  Both behaved as expected. 

> Reg. the screenshots:
> - did you take them with ksnapshot?
> - how does this actually look "on screen" (ie. is the output squeezed or
> capped?)

Taken with ksnapshot, yes.  Output is capped (can still drag windows off the screen and lose them in nothingness though).
Comment 10 Ben Daines 2013-02-22 16:33:03 UTC
Created attachment 77512 [details]
xrandr -q after disabling DisplayPort-0 via xrandr
Comment 11 Ben Daines 2013-02-22 16:36:25 UTC
Also, when I disable DisplayPort-0 via xrandr there's a transition where artifacts appear on LVDS (normal, expected behavior), however if I disable the screen via the system settings this does not happen; DisplayPort-0 just shuts off.
Comment 12 Thomas Lübking 2013-02-22 19:28:27 UTC
Ok.

1st there's some bug in krandr or libXrandr or the way krandr uses libXrandr - the screengeometry should not be 1681x1052 - this will eg. cause a failure to close a window by clicking into the upper right edge (which is out of logical screen bounds, but you'll be able to move the mouse there)

2nd kwin either does not get the signals from QApplication::desktop() or when reacting to them gets wrong values.
Please run "kwin --replace  &" from konsole, then "kdebugdialog", filter for "kwin" and ensure the "kwin" item (without any number) is checked (i suggest to uncheck "kwin (1212)" to not get lost in the other debug output)  - click "apply"
Ensure it worked by invoking "xrandr --output DisplayPort-0 --off" to deactivate the external screen "correctly"
KWin should print 
"kwin(<pid>) KWin::Workspace::screenChangeTimeout: It is time to call desktopResized"

If that worked, see whether you get the same output when altering the screen settings through the settings GUI.

If there's not such output the second time, kwin simply does not get notified about the screen change.
If there is, the provided geometry may (still) be wrong at that time.
Comment 13 Jeremy Whiting 2013-03-20 05:16:46 UTC
I've been seeing this same issue the past couple of weeks also.  At first I thought it was a problem with kscreen so disabled that, then found xrandr itself still had the same issue.  Tonight I switched to a gnome session and found xrandr updates worked fine there, so tried just xrandr --output LVDS1 --mode 1024x768 in kde and the kwin ui gets squished then.  Also running kwin --replace fixes the session so everything looks right (though it's only useng 1024 width of pixels of the laptop display, as expected).

I can test and debug fixes if wanted needed, as I run kde master (and am doing a kdesrc-build now to make sure I'm up to the latest).
Comment 14 Jeremy Whiting 2013-03-20 05:31:56 UTC
Also interestingly I'm using intel graphics, not radeon, but hit the same issue.
Comment 15 Thomas Lübking 2013-03-20 06:39:01 UTC
You won't have to replace kwin, toggling compositing twice should do.
There was a regression in master, see bug #316040

If it's not that, please see comment #12 and whether you get that debug output.
Comment 16 Jeremy Whiting 2013-03-20 16:55:13 UTC
Ah indeed, rebuilding kde-workspace fixed it because of c61081ffed38a2f124631d41cede6e2b839026c9 mentioned on that bug, thanks.
Comment 17 Thomas Lübking 2013-10-10 08:57:17 UTC
@Ben
Did your distro meanwhile switch to "kcmshell4 kscreen" and does altering the screen setup by this cause the same issues as with krandr?
Comment 18 Andrew Crouthamel 2018-11-10 03:21:05 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 19 Andrew Crouthamel 2018-11-20 03:58:53 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand.

Thank you for helping us make KDE software even better for everyone!
Comment 20 kde.org 2021-11-07 00:36:32 UTC
This issue report is quite old. Can you please confirm, that it still persists with Plasma 5.23?
Comment 21 Bug Janitor Service 2021-11-22 04:38:34 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 22 Bug Janitor Service 2021-12-07 04:36:14 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!