plasma-framework/src
Eike Hein 433b6794fe Add Qt::Dialog to default flags to make QXcbWindow::isTransient() happy.
Panel popup dialogs along with other applications of Plasma::Dialog
(e.g. Kicker's submenus) currently don't correctly set WM_TRANSIENT_FOR
to the id of their parent window on X11. This causes them to interact
badly with auto-hide panels which do not set struts, e.g. Kicker's
submenus open behind the panel.

Internally, Dialog makes calls to QWindow::setFlags when its window
type is "Normal" (the default) and otherwise uses KWindowSystem's
setType. (Kicker's subclass, SubMenu, does an additional
KWindowSystem::setType call for NET::Menu). Neither CompactApplet
nor Kicker change their Dialog's 'type' property to anything else,
so their dialogs are "Normal", thus going the setFlags route with
no setType calls.

Dialog also sets its transient parent to the window the visualParent
item is inside of.

Now here is where things break down: QXcbWindow will update
WM_TRANSIENT_PARENT for in show(), but only when an inline function
called isTransient returns true. isTransient decides this based on
window type, which is determined from the flags set with
QWindow::setFlags. Calls to KWindowSystem::setType would have no
bearing on this; there seems to be no mapping back from external
state. This is why setting Dialog.type to e.g. "DialogWindow" does
nothing.

This patch takes the route of adding Qt::Dialog to the starting
flags - after all Dialog is a dialog. That means isTransient()
will consider the window to be a transient and those
setTransientParent calls Dialog does will not be ignored. In the
case of CompactApplet, no further calls to KWS::setType are done;
Kicker continues to call it with NET::Menu to get desired window
manager behavior.

In light testing everything still seems too work, with the added
benefit of fixing:
BUG:366278

That said, the weird mess of setFlags and setType and state in the
windowing system vs. Qt is horrible and sad.

REVIEW:128571
2016-08-02 19:20:33 +09:00
..
declarativeimports [TextField] Bind to TextField length instead of text 2016-07-29 15:41:40 +02:00
desktoptheme [Breeze Plasma Theme] Add network-flightmode-on/off icons 2016-08-01 17:43:11 +02:00
plasma [Containment] Treat HiddenStatus as low status 2016-07-22 08:32:52 +02:00
plasmapkg Remove some warnings 2016-02-29 00:59:44 +01:00
plasmaquick Add Qt::Dialog to default flags to make QXcbWindow::isTransient() happy. 2016-08-02 19:20:33 +09:00
scriptengines Fix build. 2016-08-01 03:57:22 +09:00
tools fix stylesheet 2015-12-07 10:40:34 +01:00
CMakeLists.txt remove kpart related code 2016-05-19 17:47:09 +02:00
Messages.sh Consolidate all plasma-framework catalogs 2014-04-25 10:40:12 +02:00