Bug 358664

Summary: On display configuration change some maximised windows are lost
Product: [Plasma] kwin Reporter: Mal Haak <insanemal>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: major    
Priority: NOR    
Version First Reported In: 5.5.1   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Mal Haak 2016-01-28 00:24:21 UTC
I'm working on a lenovo laptop on a docking station.
When I have maximised windows that aren't Chrome or VirtualBox (Usually Konsole, but also Kate) and I dock or undock causing my external monitor to be attached/removed (thus changing my display setup) maximised windows get 'lost'

I can't see them on the task bar. I can see them as still running in top/ ps aux . I can see them in the list via 'xwininfo -tree -root' however wmctrl -l doesn't have them.

Reproducible: Always

Steps to Reproduce:
1.Maximise window
2.Dock/Undock laptop (or attach/detach monitor)
3.

Actual Results:  
Maximised windows are lost

Expected Results:  
Maximised windows are not lost

xwininfo -tree -root |grep konsole
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
     0x1a00096 "Konsole": ("konsole" "konsole")  356x199+330+60  +330+60
     0x1a00089 "() Somework — Konsole": ("konsole" "konsole")  1600x840+0+32  +0+32
     0x1a00071 "performance : vim — Konsole": ("konsole" "konsole")  1200x1888+1600+32  +1600+32
     0x1a00042 "Konsole": ("konsole" "konsole")  401x37+268+607  +268+607
     0x1a00031 "performance : zsh — Konsole": ("konsole" "konsole")  1600x840+0+32  +0+32
           0x1a00090 "malcolm : zsh — Konsole": ("konsole" "konsole")  1200x1888+0+0  +1600+32

~ ❯❯❯ wmctrl -l
0x0300040a -1             N/A Desktop — Plasma
0x0300000e -1             N/A Desktop — Plasma
0x01e0000c  0 mal-laptop.site Oracle VM VirtualBox Manager
0x05800004  0             N/A Desktop — Dolphin
0x05000001  0 mal-laptop.site Random web page - Google Chrome
0x03c0000c  0 mal-laptop.site Win7-1 [Running] - Oracle VM VirtualBox
0x050001bf  0 mal-laptop.site zabbix: Latest data [refreshed every 30 sec.] - Google Chrome
0x03400019  0             N/A N/A
0x0500003e  0 mal-laptop.site Some other random webpage - Google Chrome
0x05000040  0 mal-laptop.site Something else not important - Google Chrome
0x0500003f  0 mal-laptop.site 31.2. importlib – Convenience wrappers for __import__() — Python 2.7.11 documentation - Google Chrome
0x07600003  0 mal-laptop.site projectM
0x06a000c8  0 mal-laptop.site Rammstein - Ein Lied  ::  Amarok
0x03000023 -1             N/A Plasma
0x050001d5 -1 mal-laptop.site Chat window A
0x050001d4 -1 mal-laptop.site Chat window B
0x01a00090  0             N/A malcolm : zsh — Konsole
0x01e00103  0 mal-laptop.site VirtualBox - Information
Comment 1 Martin Flöser 2016-01-28 07:52:47 UTC
I'm quite certain that this is Qt's fault and not KWin's fault. So please run for testing another window manager (e.g. openbox) and try again.
Comment 2 Thomas Lübking 2016-01-28 10:11:16 UTC
check the status of the processes with lost windows (stopped?) and dump "xwininfo -id <ID>" and "xprop -id <ID>" for them.

As long as only Qt5 clients are affected - and given the occasion, this is probably a weird outcome of bug #341497 (in that client, apparently KWin didn't crash)
Comment 3 Mal Haak 2016-01-28 11:34:04 UTC
Due to timezone related logistics, I won't be able to test this until tomorrow (GMT+11 09:00)

I will do all the tests you are asking for. 

The most interesting thing is the applications running in the konsole sessions seem to still be running (confirmed with strace/gdb to peek at what they were up to) 

It does appear that Qt5 clients are the only ones. I think the main reason it doesn't 100% die is the configuration I am running. I've got NVIDIA Optimus configured using PRIME. That has/is caus[ed , ing] all kinds of weird behaviours around resolution changes and desktop sizes as it is. 

I was planning on lodging separate bugs on those things later. (When I get sick of things popping up menus on the wrong screen)
Comment 4 Mal Haak 2016-01-28 23:05:38 UTC
*** Comment expunged by KDE Sysadmin at the request of the original poster - contained sensitive material ***
Comment 5 Thomas Lübking 2016-01-28 23:11:10 UTC
The window is indeed unmapped by "something" (which is apparently not KWin)

You could try "xdotool windowmap 0x1a00100" to see whether it remaps and is still interactive.
Comment 6 Mal Haak 2016-01-28 23:12:24 UTC
Also, is somebody able to redact some of that... I left names in window titles as I wasn't thinking.
Comment 7 Mal Haak 2016-01-28 23:13:58 UTC
"xdotool windowmap 0x1a00100"

Works. And it gets my windows back and they are working. 

I'll bodge up a script that will keep me happy until Qt5 is patched/I have said patch.
Comment 8 Thomas Lübking 2016-01-28 23:20:42 UTC
I'm not sure we (ie. Martin) can even delete it:
https://www.bugzilla.org/docs/2.20/html/faq.html#faq-phb-deletebugs

If it's critical, we got to bounce sysadmins on this (no promise they can, though)
Comment 9 Mal Haak 2016-01-28 23:25:16 UTC
No it's fine. It's not critical.
Comment 10 Ben Cooksley 2016-01-29 09:26:11 UTC
Comment expunged as requested.