Bug 273212 - KRandR detects monitor disconnect, but doesn't resize new desktop
Summary: KRandR detects monitor disconnect, but doesn't resize new desktop
Status: RESOLVED UNMAINTAINED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_randr (show other bugs)
Version: 4.8.4
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Gustavo Pichorim Boiko
URL:
Keywords:
: 290455 (view as bug list)
Depends on: 284413
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-13 18:25 UTC by Víctor Prea
Modified: 2015-01-22 12:07 UTC (History)
20 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Víctor Prea 2011-05-13 18:25:50 UTC
Version:           unspecified (using KDE 4.6.2) 
OS:                Linux

Hi, i will try to explain this bug the best I can, as my english is not good...
I'm using Kubuntu 11.04 on a Lenovo ThinkPad. I also have an external LCD monitor that I connect to VGA1 output to have a dual-monitor desktop.
When I connect my monitor, Kubuntu detects the event and ask me to reconfigure screens. Everything works fine.
When I disconnect, Kubuntu detects the event too, I disable the VGA1 output, accept changes, but the desktop still works as if there were a second monitor connected (I can drag windows to the other display).
I have made a video of this bug, so you can understand better:
http://www.youtube.com/watch?v=YppMpv_FLx0

Reproducible: Always

Steps to Reproduce:
Disconnect VGA1 output of my laptop.
KRandR launches.
Disable VGA1 output.

Actual Results:  
I can drag windows outside my new desktop size, as if VGA1 output were still active.

Expected Results:  
New desktop size should be LVDS1 output only (1366x768), and not be able to drag windows outside this screen.
Comment 1 Sander Alberink 2011-06-29 13:56:57 UTC
I can fully confirm this behaviour. The exact symptom arises on a Dell Latitude D620 with Intel 945 graphics. Upon disconnecting the secondary monitor, the desktop will not resize to the new desktop size, instead it keeps thinking that the secondary monitor is attached with respect to screen size.
Comment 2 Alex Fiestas 2011-07-21 23:33:22 UTC
Can you check if this still happens on kde 4.7 ? and master?

Thanks!
Comment 3 Víctor Prea 2011-07-22 01:06:49 UTC
Alex, I'm sorry, I don't know how to update to 4.7. I'm using Kubuntu 11.04. Maybe Kubuntu 11.10 will use 4.7.
Comment 4 reescf 2012-02-08 23:32:44 UTC
I'm using 4.8 and am seeing this problem. In my case, I loose all control of KDE because I have my laptop screen below the external VGA and this is somehow outside of the accessible area. Last week, KDE still displayed but accepted no input. The only working interaction was switch to console on another tty. This week, the screen went entirely black. I can tell the desktop was still responding because e.g. connecting and disconnecting AC resulted in the usual sound signals.

The only way to restore functionality is to reboot the machine. (I haven't tried restarting KDM or X because I'm not sure how to do this cleanly from the console.

I have the intel integrated graphics and am not using any proprietary drivers.

What makes this worse is that it seems to be impossible to change the size or positioning from the console. I'm not very familiar with xrandr but I get errors with commands which I think should work. For example, I can't resize the desktop because it complains everything won't fit and VGA1 still has a size even though it is disconnected. I would think this might be an X issue but it seems specific to KDE.

I wasn't sure what information to collect so I did my best today. But if somebody can tell me in advance what commands to run to help debug, I'd be happy to do so.

Setup today: connect laptop to VGA output. This is an external monitor with the external monitor mirrored on a screen via LCD beamer. Dialog pops up asking me to configure. Unlike last week, I manage to get this right first time. 

~2 hours connected. Everything is fine.

Disconnect VGA out. Wait for configuration dialog. Confirm VGA being disabled with laptop screen as only video output. OK it. Wait.

Try to sleep laptop. (Not very clear this worked though I never usually have problems.)

Wake laptop. Screen is black. Assume this is a wake-issue. Try to wake laptop. Nothing. Disconnect & reconnect AC for no obvious reason. Realise desktop is live and I just can't see it.

Switch to tty1, saving output of a selection of the commands I tried to file.

LVDS1 is the laptop screen, obviously. 1366x768.
VGA1 is the disconnected VGA output. I had been using 1024x768 resolution for the beamer projection.

$ xrandr --current

Screen 0: minimum 320 x 200, current 1366 x 1536, maximum 8192 x 8192
LVDS1 connected 1366x768+0+768 (normal left inverted right x axis y axis) 256mm x 144mm
   1366x768       60.0*+
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
VGA1 disconnected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)

$ xrandr --current --verbose

Screen 0: minimum 320 x 200, current 1366 x 1536, maximum 8192 x 8192
LVDS1 connected 1366x768+0+768 (0x45) normal (normal left inverted right x axis y axis) 256mm x 144mm
        Identifier: 0x41
        Timestamp:  63480103
        Subpixel:   horizontal rgb
        Gamma:      1.0:1.0:1.0
        Brightness: 1.0
        Clones:    
        CRTC:       0
        CRTCs:      0 1
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter: 
        EDID:                                                                                                                   
                00ffffffffffff004ca3433100000000                                                                                
                00150103801a0e78ea1d859156598f26
                18505400000001010101010101010101
                010101010101b91d56f0500016303020
                25000090100000190000000f00000000
                000000000025d9066a00000000fe0053
                414d53554e470a204ca34154000000fe
                004c544e3131364154303634303200e1
        BACKLIGHT: 12 (0x0000000c)      range:  (0,15)
        Backlight: 12 (0x0000000c)      range:  (0,15)
        scaling mode:   Full aspect
                supported: None         Full         Center       Full aspect 
  1366x768 (0x45)   76.1MHz -HSync -VSync *current +preferred
        h: width  1366 start 1414 end 1446 total 1606 skew    0 clock   47.4KHz
        v: height  768 start  770 end  775 total  790           clock   60.0Hz
  1024x768 (0x46)   65.0MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock   48.4KHz
        v: height  768 start  771 end  777 total  806           clock   60.0Hz
  800x600 (0x47)   40.0MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock   37.9KHz
        v: height  600 start  601 end  605 total  628           clock   60.3Hz
  800x600 (0x48)   36.0MHz +HSync +VSync
        h: width   800 start  824 end  896 total 1024 skew    0 clock   35.2KHz
        v: height  600 start  601 end  603 total  625           clock   56.2Hz
  640x480 (0x49)   25.2MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock   31.5KHz
        v: height  480 start  490 end  492 total  525           clock   59.9Hz
VGA1 disconnected 1024x768+0+0 (0x46) normal (normal left inverted right x axis y axis) 0mm x 0mm
        Identifier: 0x42
        Timestamp:  63480103
        Subpixel:   unknown
        Gamma:      1.0:1.0:1.0
        Brightness: 1.0
        Clones:    
        CRTC:       1
        CRTCs:      0 1
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter: 
HDMI1 disconnected (normal left inverted right x axis y axis)
        Identifier: 0x43
        Timestamp:  63480103
        Subpixel:   unknown
        Clones:    
        CRTCs:      0 1
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter: 
        Broadcast RGB:  Full
                supported: Full         Limited 16:2
        audio:  auto
                supported: off          auto         on          
DP1 disconnected (normal left inverted right x axis y axis)
        Identifier: 0x44
        Timestamp:  63480103
        Subpixel:   unknown
        Clones:    
        CRTCs:      0 1
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter: 
        Broadcast RGB:  Full
                supported: Full         Limited 16:2
        audio:  auto
                supported: off          auto         on          

$ xrandr --fb 1366x768 --output LVDS1 --mode 1366x768 --pos 0x0 --output VGA1 --off

xrandr: Configure crtc 0 failed
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  150 (RANDR)
  Minor opcode of failed request:  21 (RRSetCrtcConfig)
  Serial number of failed request:  37
  Current serial number in output stream:  37

What I don't quite understand is why I lose everything. While the VGA is connected, I still have display on my laptop screen, including a top panel etc. My presentation window is on the external display but my custom wallpaper etc. stays on the laptop screen. So why do I just get blackness afterwards? Why don't I at least get that stuff, even if new windows are misplaced?

I am happy to help troubleshoot this if I can because this is a killer for me. I need this stuff to work as I switch classes etc. Especially in front of audiences!
Comment 5 Andreas 2012-03-12 19:17:45 UTC
I experience possibly related with a ThinkPad T61 with intel graphics and kubuntu with backport to kde 4.8.1 . I have a xrandr script which is supposed to switch displays and then hibernate. Often this results in black screen and it is not possible to switch to shell, so the only way to proceed is shutdown with power botton. The system seems active but it does not seem to react to keybord input. The problem seems to be indipendent of whether I use two screens or not (usually I work on the external monitor only)
Comment 6 Andreas 2012-03-12 19:40:25 UTC
Somebody described this kind of problem here:
https://bbs.archlinux.org/viewtopic.php?id=134886
Comment 7 Amichai Rothman 2012-05-21 09:23:15 UTC
I'm having the same issue on Kubuntu 12.04 with KDE 4.8.3 (and Intel HD Graphics 3000). After disconnecting the external HDMI monitor, the 'logical' screen size remains too large even though the display is properly marked as disconnected. Running xrandr -s with the dimensions of the laptop built-in display fixes it:

$ xrandr --current
Screen 0: minimum 320 x 200, current 3520 x 1080, maximum 8192 x 8192
eDP1 connected 1600x900+0+0 (normal left inverted right x axis y axis) 293mm x 164mm
   1600x900       60.0*+
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected 1920x1080+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
DP1 disconnected (normal left inverted right x axis y axis)
  1920x1080 (0x46)  148.5MHz
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock   67.5KHz
        v: height 1080 start 1084 end 1089 total 1125           clock   60.0Hz

$ xrandr -s 1600x900

$ xrandr --current
Screen 0: minimum 320 x 200, current 1600 x 900, maximum 8192 x 8192
eDP1 connected 1600x900+0+0 (normal left inverted right x axis y axis) 293mm x 164mm
   1600x900       60.0*+
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)

(as you can see the 'current' size of Screen 0 is fixed by this, but it of course should happen automatically the moment the external monitor is unplugged.)
Comment 8 pdf 2012-07-19 09:22:55 UTC
Verified still occurring on 4.8.4, why is this still NEEDSINFO WAITINGFORINFO?
Comment 9 Myriam Schweingruber 2012-07-19 22:04:09 UTC
This seems to have somehow escaped our rader, setting status correctly. Thank you all for your feedback.
Comment 10 Myriam Schweingruber 2012-07-19 22:15:46 UTC
*** Bug 290455 has been marked as a duplicate of this bug. ***
Comment 11 Alexis Lahouze 2012-10-24 20:55:32 UTC
Hi,
I am using KDE 4.9.2 and the issue is still present.

Whenever I disconnect the second screen without having changed the configuration before, KDE detects the disconnection, but doesn't apply a new configuration automatically.

If I used only the second screen, with LVDS off, there is no way to reconfigure the screens when I disconnect it...

I am using a Latitude E6230, with i915 driver.
Comment 12 GSC 2012-11-22 13:19:08 UTC
Still a problem in 4.9.3.
Comment 13 Davi Dagostin Gonçalves 2013-03-07 13:33:14 UTC
This bug persists in 4.9.4, 4.9.5 and 4.10.
Comment 14 Alex Fiestas 2013-03-07 15:28:38 UTC
We are rewriting this the result is called "kscreen", you should checkout it.
Comment 15 Alexander 2013-03-29 13:45:27 UTC
Kscreen looks better, but not solves the problem. When I disconnect HDMI cable of second monitor, screen still expanded and all apps still at the part of screen where second monitor was. Display should be disabled when it disconnected. 
KScreen 0.0.71-ubuntu1~ubuntu12.10.1~ppa1
KDE 4.10.1
Comment 16 Christian González 2013-03-29 15:45:27 UTC
Under Kubuntu 13.04 (kscreen 0.0.71+git20130) this seems to work correctly. When monitor is plugged out, all apps of the plugged out monitor are shifted to the remaining primary monitor.
Just the dialog showing the monitors does not show the correct monitor positions after plugging in again and seems to be a bit buggy.
Comment 17 fereneadams 2013-07-02 19:02:28 UTC
Under KDE 4.8.4 in debian testing this bug remains. As a workaround, I've discovered that I can reset my screen by using the xrandr command to remove the unplugged monitor. For me, that consists of "xrandr --output HDMI1 --off".
Comment 18 Alex Fiestas 2013-07-02 20:56:21 UTC
This has been fixed in the new XRandR support (KScreen).
Comment 19 Joe Johnson 2013-11-04 01:31:53 UTC
I'm experiencing this exact problem (with HDMI out) on a Dell Inspirion N5050 with Kubuntu 12.04 (Precise Pangolin), but not on my HP laptop. Both were installed using the same Live CD and are fully up-to-date.

Every time I unplug the HDMI, it prompts to configure the display. I click configure and ensure that HDMI is disabled. Apply and ok. The output from Xrandr with both displays connected, and after removing the HDMI and accepting configure, are below:

username@hostname:~$ uname -ar
Linux 3.2.0-55-generic #85-Ubuntu SMP Wed Oct 2 12:29:27 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
username@hostname:~$ xrandr
Screen 0: minimum 320 x 200, current 2646 x 768, maximum 8192 x 8192
LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   1366x768       59.6*+
   1360x768       59.8     60.0  
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1280x720+1366+0 (normal left inverted right x axis y axis) 16mm x 9mm
   1280x720       60.0*+
   720x480        59.9  
   640x480        60.0  
DP1 disconnected (normal left inverted right x axis y axis)
username@hostname:~$ xrandr 
Screen 0: minimum 320 x 200, current 2646 x 768, maximum 8192 x 8192
LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   1366x768       59.6*+
   1360x768       59.8     60.0  
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected 1280x720+1366+0 (normal left inverted right x axis y axis) 0mm x 0mm
DP1 disconnected (normal left inverted right x axis y axis)
  1280x720 (0x124)   74.2MHz
        h: width  1280 start 1390 end 1430 total 1650 skew    0 clock   45.0KHz
        v: height  720 start  725 end  730 total  750           clock   60.0Hz
username@hostname:~$ 
username@hostname:~$ which kscreen
username@hostname:~$ which xrandr
/usr/bin/xrandr
username@hostname:~$ xrandr -v
xrandr program version       1.3.5
Server reports RandR version 1.3




Reproducible: Always
Comment 20 Joe Johnson 2013-11-04 01:36:49 UTC
I forgot to add lspci:

username@hostname:~$ lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)

According to the Dell's specs it is an Intel® HD Graphics 3000.
Comment 21 David Edmundson 2015-01-22 12:07:47 UTC
Thanks for reporting your bug.

Since reporting Krandr has since been replaced by KScreen. It is available in the Plasma 4 series, and is default in Plasma 5 onwards.

I hope this solves your issue. If you still have a problem after upgrading please reopen a new bug under kscreen.

Thanks