Bug 158262 - Insufficient stacking order handling for deleted windows
Summary: Insufficient stacking order handling for deleted windows
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Unclassified
Component: compositing (show other bugs)
Version: unspecified
Platform: Ubuntu Packages Linux
: NOR normal with 3 votes (vote)
Target Milestone: 4.9
Assignee: KWin default assignee
URL: https://git.reviewboard.kde.org/r/104...
Keywords:
: 176388 191417 210109 274174 280513 284400 290529 293831 312273 (view as bug list)
Depends on:
Blocks: 179924
  Show dependency treegraph
 
Reported: 2008-02-23 10:57 UTC by Martin Flöser
Modified: 2012-12-27 17:58 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.9.0


Attachments
Example (740.31 KB, video/ogg)
2012-07-18 19:57 UTC, Alexander
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Flöser 2008-02-23 10:57:37 UTC
Version:            (using KDE 4.0.1)
Installed from:    Ubuntu Packages
OS:                Linux

I noticed this behaviour for Kopete. My contact list is configured to disappear automatically. If I have the contact list open and another window is in front of the contact list the contact list will appear as top most window when it disappears as the minimize animation is started. This can be quite disturbing.
Comment 1 FiNeX 2008-03-14 15:35:04 UTC
I've reproduced this behaviour on revision 785508 but only with desktop effects enabled
Comment 2 Martin Flöser 2009-05-03 10:21:23 UTC
*** Bug 191417 has been marked as a duplicate of this bug. ***
Comment 3 Martin Flöser 2009-10-29 18:19:23 UTC
*** Bug 210109 has been marked as a duplicate of this bug. ***
Comment 4 Martin Flöser 2009-12-11 11:20:26 UTC
*** Bug 176388 has been marked as a duplicate of this bug. ***
Comment 5 Marcus Hähnel 2011-02-12 18:19:19 UTC
I've started looking at the problem and can confirm it for any window that is in the background and to be closed.

I traced the behaviour back to the fade plugin (thats why it is only visible when effects are enable).

Still it is a curious bug, since the minimizewindows plugin, that also uses opacity changes as effect does not suffer changes in stacking order. I will look into this further and might have a fix for it.
Comment 6 Martin Flöser 2011-02-12 18:48:41 UTC
On Saturday 12 February 2011 18:19:20 Marcus Hähnel wrote:
> I've started looking at the problem and can confirm it for
> any window that is in the background and to be closed.
Just to let you know: I completely investigated the issue and know what is 
causing it. Fixing it is very complex and requires quite some changes to KWin 
internals. I am planning to do this finally for the 4.7 timeframe as it will 
bring a significant performance boost to fix it properly. Thanks for looking 
into it, but I doubt it can be done by a new contributor :-(

To just outline what is causing the problem: the stacking order is queried 
from the X server before each rendered frame. Unmanaged and deleted windows 
are added to the top of the list. As the deleted windows do not have a real X 
window anymore their position in the stacking order is lost.

To fix it properly KWin has to cache the stacking order and insert deleted and 
unmanaged windows into it. Only when the stacking order changes it needs to be 
recreated with the non X clients being kept at their position. This will 
improve the performance as we don't need the X roundtrip anymore and we open 
our stacking order handling to make things like Wayland clients possible.
Comment 7 Martin Flöser 2011-09-25 08:45:51 UTC
*** Bug 280513 has been marked as a duplicate of this bug. ***
Comment 8 Thomas Lübking 2011-10-18 19:07:17 UTC
*** Bug 284400 has been marked as a duplicate of this bug. ***
Comment 9 Martin Flöser 2012-01-03 21:01:41 UTC
*** Bug 290529 has been marked as a duplicate of this bug. ***
Comment 10 Martin Flöser 2012-02-11 11:23:37 UTC
*** Bug 293831 has been marked as a duplicate of this bug. ***
Comment 11 ultr 2012-02-11 15:21:39 UTC
> I traced the behaviour back to the fade plugin
> (thats why it is only visible when effects are enable).

The Glide plugin has the same issues as well.
Comment 12 Thomas Lübking 2012-02-11 15:23:03 UTC
No need for further comments, see comment #6
The issue is global and the source is known.
Comment 13 Martin Flöser 2012-02-11 15:27:24 UTC
btw this bug report is on my TODO list for 4.9. I have an idea how to solve it 
and it will make porting to Wayland easier.

<devnote>Stacking Order needs to become a QList<Toplevel*> instead of 
QList<Client*>.</devnote>
Comment 14 Martin Flöser 2012-03-05 05:19:25 UTC
*** Bug 274174 has been marked as a duplicate of this bug. ***
Comment 15 Martin Flöser 2012-04-20 06:48:50 UTC
Git commit 431aad6d6994695e72697fcc3299ec2cb6f0684e by Martin Gräßlin.
Committed on 09/04/2012 at 11:06.
Pushed by graesslin into branch 'master'.

Keep position in stacking order for deleted windows

Workspace::addDeleted swaps the Client with the Deleted in the
stacking order. For Unmanaged windows the Deleted is appended
to the stacking order which is the same layer.

When the deleted is closed the window is removed from the stacking
order.

The result is that a deleted window is no longer raised above all
other clients.

REVIEW: 104519
FIXED-IN: 4.9.0

M  +1    -1    kwin/deleted.cpp
M  +0    -3    kwin/layers.cpp
M  +15   -3    kwin/workspace.cpp
M  +1    -1    kwin/workspace.h

http://commits.kde.org/kde-workspace/431aad6d6994695e72697fcc3299ec2cb6f0684e
Comment 16 Alexander 2012-07-18 19:57:39 UTC
Created attachment 72614 [details]
Example

When I closing minimized window it still appears at top before being closed.

KDE 4.8.97
Comment 17 Martin Flöser 2012-07-18 20:04:35 UTC
(In reply to comment #16)
> When I closing minimized window it still appears at top before being closed.
No, that is a different bug and seems to be in the fade effect which seems to be executed for minimized windows.
Comment 18 Thomas Lübking 2012-12-27 17:58:33 UTC
*** Bug 312273 has been marked as a duplicate of this bug. ***