Bug 191310 - org.kde.KWin.doNotManage unmanaged windows are added to alt-tab view and are never cleaned from the workspace
Summary: org.kde.KWin.doNotManage unmanaged windows are added to alt-tab view and are ...
Status: RESOLVED INTENTIONAL
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-02 02:47 UTC by James
Modified: 2012-04-08 21:22 UTC (History)
3 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 James 2009-05-02 02:47:41 UTC
Version:            (using Devel)
Compiler:          gcc 4.3.3 
OS:                Linux
Installed from:    Compiled sources

org.kde.KWin.doNotManage is essential to avoid apps from flickering when they are about to be re-parented e.g.

kdelibs/khtml/java/kjavaappletwidget.cpp

Unfortunately when using this method, the target window is added to the workspace as an alt-tab switchable task, and even after the embedded application has exited it's window structure remains in the Workspace object (and hence in the alt-tab list) forever!

Without the call to org.kde.KWin.doNotManage, the window to be re-parented is added to the workspace, then kwin captures the re-parent request when the window is re-parented to the target widget and removes it from the workspace list as expected, unfortunately causing a flicker as the window is drawn and then re-parented.

I've looked into the code and the fix seems quite trivial, I'm happy to send you a patch if you agree with this issue.
Comment 1 James 2009-05-02 03:01:07 UTC
I just ran a test.. I called org.kde.KWin.doNotManage '.*' then ran konsole..

I then killed konsole from the shell with `kill' and it was removed from the workspace as expected.

The application only remains in the workspace if:
 * org.kde.KWin.doNotManage is called AND
 * the window is reparented.

To me it seems inconsistet that org.kde.KWin.doNotManage being called affects whether a re-parented window belongs to the workspace.
Comment 2 James 2009-07-16 13:06:54 UTC
I'd appreciate some feedback as I'd like to start working on this. The patch is trivial.
Comment 3 James 2010-08-15 18:22:39 UTC
For a 2-line fix this is being ignored for a long time.
Comment 4 Martin Flöser 2010-08-15 18:29:28 UTC
patches are welcome
Comment 5 Thomas Lübking 2010-08-15 20:14:06 UTC
"setSkipSwitcher(true);" in either manage.cpp:559 (least invasive, should be safe) or client.cpp:1068, or "setSkipSwitcher(hidden)"; in client.cpp:842 (most "dangerous", but the issue of a "wrong" switcher entry might actually apply to all "hidden" clients)

However the whole thing looks like a horrible hack, why can't one pass a window parameter to java like to eg. mplayer? It's probably one of the most embedded clients ever ... =\
Comment 6 FiNeX 2010-10-10 21:45:22 UTC
Hi! What is the status of this report? Is the Thomas hint useful, has it been applied (if it is correct)?
Comment 7 FiNeX 2010-10-10 21:48:25 UTC
moved back to unconfirmed
Comment 8 Martin Flöser 2011-01-21 23:29:45 UTC
I just looked into the source code and don't like this hack at all. Given that both Java Applets and KHTML are not really used any more, I rather tend to remove the hack instead of putting more glue to it.

According to lxr it is only used by the khtml java applets and KStart when used to send a window to the "system tray in kicker". Yes that code has not been touched in years.

An idea would be to try to make the hack less hacky or even to remove the hack and replace it with a KWin script. I assume that the current hack is broken even stronger.
Comment 9 Martin Flöser 2012-04-08 21:22:46 UTC
doNotManage is a horrible hack for Java Applets. Let's keep it in this state for Java Applets and don't extend it.

For the first version of KWin based on KF5 I do no longer want to have this functionality at all and it will just be dropped.