Bug 361704 - window on external screen disappears when hibernating with external screen connected and resuming when it is not connected
Summary: window on external screen disappears when hibernating with external screen co...
Status: RESOLVED DUPLICATE of bug 341497
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.5.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-13 06:48 UTC by Martin Steigerwald
Modified: 2016-04-14 20:49 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
xwininfo -root -tree after external display disconnected, kmail window still exists (10.79 KB, text/plain)
2016-04-14 06:34 UTC, Martin Steigerwald
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Steigerwald 2016-04-13 06:48:16 UTC
I have KMail and Konsole and other apps on external screen. I hibernate the laptop. Next morning I resume it at work, without external screen connected (cause I hold a training where I don´t have one for the laptop). KMail window is gone. Konsole window is gone.

Reproducible: Always

Steps to Reproduce:
1. Open an application window on external screen.
2. Hibernate.
3. Disconnect external screen
4. Resume

Actual Results:  
I had KMail and konsole window on external screen.

KMail window gone. It is visible on the laptop screen in any activity. It is not even in window bar in control panel. Process still running.

Same with Konsole except process not running anymore.

Akregator which was on laptop screen at the time of hibernation still is displayed correctly.

kscreen seems to have recognized properly that external screen is gone. At least it is not displayed anymore in systemsettings. xrandr also only lists laptop screen.

Expected Results:  
Windows that were on the external screen are relocated to the internal screen when the external screen is not available anymore.

Basic rule for all of this: A window is always visible or minimized and can be made visible. Never ever a window is not accessible as long as at least *one* display is working.

kwin from Debian Experimental 4:5.5.4-2 on Debian Sid/Experimental. Qt 5.5.1.

system and xrandr info, for now without external display connected:

martin@merkaba:~> phoronix-test-suite system-info

Phoronix Test Suite v5.2.1
System Information

Hardware:
Processor: Intel Core i5-2520M @ 3.20GHz (4 Cores), Motherboard: LENOVO 42433WG, Chipset: Intel 2nd Generation Core Family DRAM, Memory: 16384MB, Disk: 300GB INTEL SSDSA2CW30 + 480GB Crucial_CT480M50, Graphics: Intel HD 3000 (1300MHz), Audio: Conexant CX20590, Monitor: P24T-7 LED, Network: Intel 82579LM Gigabit Connection + Intel Centrino Advanced-N 6205

Software:
OS: Debian unstable, Kernel: 4.6.0-rc2-tp520-btrfstrim+ (x86_64), Desktop: KDE Frameworks 5, Display Server: X Server 1.18.3, Display Driver: intel 2.99.917, OpenGL: 3.3 Mesa 11.1.2, Compiler: GCC 5.3.1 20160409, File-System: btrfs, Screen Resolution: 1920x1080


martin@merkaba:~> xrandr                         
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
LVDS1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
   1920x1080     60.00*+  59.93    50.00  
   1680x1050     59.95    59.88  
   1600x1024     60.17  
   1400x1050     59.98  
   1280x1024     60.02  
   1440x900      59.89  
   1280x960      60.00  
   1360x768      59.80    59.96  
   1152x864      60.00  
   1024x768      60.00  
   800x600       60.32    56.25  
   640x480       59.94  
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)
HDMI2 disconnected (normal left inverted right x axis y axis)
HDMI3 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
DP3 disconnected (normal left inverted right x axis y axis)


I am tempted to classify this as critical, cause making an application window inaccessible could be a reason for data loss. Yet, one usually can still send it a TERM signal and I´d hope it would prompt for any unsaved work to be saved on the internal screen then. So leaving as normal for now.
Comment 1 Martin Steigerwald 2016-04-13 06:50:41 UTC
kscreen is also 5.5.4 on the system. KF5 is compiled from git master as of last weekend. 5.6 Plasma is not yet available on Debian and free space on filesystem is small, so compiling it from master might exceed available free space. Yet I could compile parts of Plasma. I.e. just the window manager. I have kdesrc-build installed and setup.
Comment 2 Thomas Lübking 2016-04-13 07:11:32 UTC
> It is not even in window bar in control panel.

> Same with Konsole except process not running anymore.

(Next time) check the output of "xwinfo -root -tree" on whether the window actually still exists (the taskbar and kwin are different processes) - the window is probably gone and that is because multiscreen is completely FUBAR in Qt5 (and plasmashell in addition, but that's not the problem here), ie. the bug is in the clients and caused by Qt.

See bug #341497 - don't even try to trigger randr events of any type.

*** This bug has been marked as a duplicate of bug 341497 ***
Comment 3 Martin Steigerwald 2016-04-13 09:25:53 UTC
Hmmm, I didn´t see any kwin_x11 crashes. Maybe not reported by Dr. Konqi?

I will try the xwinfo -root -tree thing next time and post here.
Comment 4 Thomas Lübking 2016-04-13 09:50:48 UTC
it's not a kwin crash.
*every* qt5 client is prone to segfault or misbehave on randr events (in this case konsole/kmail)

it's not really a dupe, just belongs into the same epic qt5 let-down
Comment 5 Martin Steigerwald 2016-04-14 06:34:19 UTC
Created attachment 98394 [details]
xwininfo -root -tree after external display disconnected, kmail window still exists

Thomas, the kmail window still exists but is not shown in window bar in control panel. I not reopening for now, since the QTBUG mentioned in bug #341497 also talks about disappeared windows.

> xwininfo -root -tree

xwininfo: Window id: 0xd5 (the root window) (has no name)

  Root window id: 0xd5 (the root window) (has no name)
  Parent window id: 0x0 (none)
     150 children:
     0x240004d "krunner": ("krunner" "krunner")  756x171+582+0  +582+0
     0x7800001 (has no name): ()  1x1+0+0  +0+0
     0x1400001 (has no name): ()  1x1+0+0  +0+0
     0x481fa87 "Einrichten — KMail": ("kmail" "kmail2")  1181x797+2290+142  +2290+142
     0x481fa85 "KMail": ("kmail" "kmail2")  484x462+2131+568  +2131+568
     0x481fa83 "KMail": ("kmail" "kmail2")  776x33+2401+188  +2401+188
     0x481fa81 "KMail": ("kmail" "kmail2")  348x131+2872+335  +2872+335
     0x481fa7f "KMail": ("kmail" "kmail2")  455x193+2872+304  +2872+304
     0x481fa7d "KMail": ("kmail" "kmail2")  334x645+2538+304  +2538+304
     0x481fa79 "KMail": ("kmail" "kmail2")  22x22+2109+343  +2109+343
     0x481fa77 "KMail": ("kmail" "kmail2")  477x207+2456+75  +2456+75
     0x481fa75 "KMail": ("kmail" "kmail2")  417x324+2366+75  +2366+75
     0x481fa73 "KMail": ("kmail" "kmail2")  484x631+2207+75  +2207+75
     0x481fa71 "KMail": ("kmail" "kmail2")  668x552+2132+75  +2132+75
     0xa000ba "Akregator": ("akregator" "akregator")  1920x1042+1920+38  +1920+38
     0x481f9e8 "Lokale Ordner/[…]/_Posteingang — KMail": ("kmail" "kmail2")  1920x1042+1920+38  +1920+38
        8 children:
        0x481fa0c "KMail": ("kmail" "kmail2")  24x24+1209+609  +3129+647
        0x481fa0a "KMail": ("kmail" "kmail2")  1920x937+0+75  +1920+113
        0x481fa08 "KMail": ("kmail" "kmail2")  1920x38+0+37  +1920+75
        0x481fa06 "KMail": ("kmail" "kmail2")  1920x37+0+0  +1920+38
        0x481fa04 "KMail": ("kmail" "kmail2")  709x148+1211+864  +3131+902
        0x481fa02 "KMail": ("kmail" "kmail2")  1920x30+0+1012  +1920+1050
        0x481f9ec "KMail": ("kmail" "kmail2")  1920x937+0+75  +1920+113
           1 child:
           0x481f9ee "KMail": ("kmail" "kmail2")  1920x937+0+0  +1920+113
              4 children:
              0x481fa00 "KMail": ("kmail" "kmail2")  1x1+0+0  +1920+113
              0x481f9fe "KMail": ("kmail" "kmail2")  5x937+478+0  +2398+113
              0x481f9f2 "KMail": ("kmail" "kmail2")  1439x937+481+0  +2401+113
                 4 children:
                 0x481f9fc "KMail": ("kmail" "kmail2")  5x937+748+0  +3149+113
                 0x481f9fa "KMail": ("kmail" "kmail2")  100x30+0+0  +2401+113
                 0x481f9f8 "KMail": ("kmail" "kmail2")  750x937+0+0  +2401+113
                 0x481f9f4 "KMail": ("kmail" "kmail2")  688x937+751+0  +3152+113
                    1 child:
                    0x481f9f6 "KMail": ("kmail" "kmail2")  688x937+0+0  +3152+113
              0x481f9f0 "KMail": ("kmail" "kmail2")  480x937+0+0  +1920+113
        0x481f9ea "KMail": ("kmail" "kmail2")  160x160+0+0  +1920+38
     0x1bab225 "KWin": ("kwin_x11" "kwin")  32x32+-32+-32  +-32+-32

Attached is the full window list with some window titles shortened due to privacy.
Comment 6 Thomas Lübking 2016-04-14 06:48:23 UTC
please check "xwininfo" on such window - it apparenty fell out of management (maybe it's unmapped?)
Comment 7 Martin Steigerwald 2016-04-14 07:54:30 UTC
I restarted kmail, but Akregator still hides away, seems the window is unmapped:

> xwininfo -name "Akregator"

xwininfo: Window id: 0xa000ba "Akregator"

  Absolute upper-left X:  1920
  Absolute upper-left Y:  38
  Relative upper-left X:  1920
  Relative upper-left Y:  38
  Width: 1920
  Height: 1042
  Depth: 24
  Visual: 0xba
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0xa000b9 (not installed)
  Bit Gravity State: ForgetGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsUnMapped
  Override Redirect State: no
  Corners:  +1920+38  --1920+38  --1920-0  +1920-0
  -geometry 1920x1042+1920-0
Comment 8 Martin Steigerwald 2016-04-14 07:57:40 UTC
Any further info you´d still want for that unmapped Akregator window? Otherwise I´d restart Akregator as well in order to use it again :)
Comment 9 Thomas Lübking 2016-04-14 10:28:57 UTC
Sorry, you hopefully didn't wait too long ;-)

Pretty much as predicted. The window got unmapped, thus fall out of management and thus is neither listed in the taskbar nor geometry corrected by the WM. It's completely ignored by everything (except the client, which may re-use it later on)

The bottom line is really that Qt is completely broken reg. randr events (I doubt you'll see a non-qt5 client behaving this way)

Pray for resolution in Qt 5.6 (which however has other regressions, *sigh*)
Comment 10 Martin Steigerwald 2016-04-14 20:49:55 UTC
Hmmm, thanks. I think it is of big importance to focus on the stability of the whole stack. In the end no matter whether its Qt or KF5 / Plasma causing the issue if the user experience is affected like that. I still think I do not yet have back the same stability as with latest KDE SC 4.14 or KDE 3.x, even though multiscreen always had issues for me. All the best to those who are into fixing these issues. Maybe only with Wayland this multiscreen stuff will finally work. Its about time. But what do I write there, I bet you know all this. Thanks again, Martin