Bug 368956 - Windows with Qt::Tool windowFlag are appearing in the taskbar
Summary: Windows with Qt::Tool windowFlag are appearing in the taskbar
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager (show other bugs)
Version: 5.7.4
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-17 15:05 UTC by Sergio Martins
Modified: 2016-09-19 07:51 UTC (History)
2 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 Sergio Martins 2016-09-17 15:05:23 UTC
Windows, macOS, KDE4 and most versions of KDE5 had the correct behavior, but the latest versions of plasma5 have this bug, it started recently.

#include <QApplication>
#include <QWidget>
#include <QtWidgets>

int main(int argc, char **argv)
{
    QApplication app(argc, argv);

    QWidget w;
    w.setWindowFlags(w.windowFlags() | Qt::Tool);
    w.show();

    return app.exec();
}


Reproducible: Always
Comment 1 Eike Hein 2016-09-17 15:18:14 UTC
What NETWM window type does Qt::Tool correspond to?

What's a real-world app use case I could test?
Comment 2 Kai Uwe Broulik 2016-09-17 15:44:26 UTC
According to [1] Qt::Tool corresponds to _NET_WM_WINDOW_TYPE_UTILITY

[1] https://code.qt.io/cgit/qt/qtbase.git/tree/src/plugins/platforms/xcb/qxcbwindow.cpp#n1865
Comment 3 Eike Hein 2016-09-17 15:47:33 UTC
We hide _NET_WM_WINDOW_TYPE_TOOL but do show _NET_WM_WINDOW_TYPE_UTILITY. This should have been the same in Plasma 4 and previous versions of Plasma 5, actually. I'd need some real world app examples to see whether that makes sense or not. Until then we'd err on the side of showing more rather than fewer windows.
Comment 5 Eike Hein 2016-09-19 07:51:46 UTC
Git commit 7dee461947ae2fa6666cf7a6d0234fc92cabcc66 by Eike Hein.
Committed on 19/09/2016 at 07:51.
Pushed by hein into branch 'Plasma/5.8'.

Treat NET::Utility type windows as SkipTaskbar.

Summary:
Utility windows (NET::Utility/_NET_WM_WINDOW_TYPE_UTILITY) should
not be on the Task Manager, but they should be on the Pager. This
patch achieves this by evaluating the window type in the
AbstractTasksModel::SkipTaskBar data role.

I considered the alternative approach of making a new
AbstractTasksModel::IsUtilityWindow (or similar) data role and
adding a pass to evaluate it to TaskFilterProxyModel, then
configuring the filter models in TasksModel and the Pager backend
differently. But this is not very extensible. Then I realized that
AbstractTasksModel data roles do not and should not reflect X11
idioms anyway; the point of the library is to abstract for the
purpose of UI, and what XWindowTasksModel considers "SkipTaskBar"
is really an implementation detail. This makes all the more sense
considering on Wayland we have no notion of window types (beyond
"popup") yet, and don't quite now how it's going to evolve.

Various API docstrings have been changed to better reflect that
the meaning of the data role doesn't map to anything specific in
the tasks.

Reviewers: #plasma, davidedmundson, broulik

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D2807

M  +2    -2    libtaskmanager/abstracttasksmodel.h
M  +16   -16   libtaskmanager/taskfilterproxymodel.h
M  +9    -1    libtaskmanager/xwindowtasksmodel.cpp

http://commits.kde.org/plasma-workspace/7dee461947ae2fa6666cf7a6d0234fc92cabcc66