Commit b7ad4bcf authored by Martin Flöser's avatar Martin Flöser

Keep fullscreen windows in active layer based on transients not the group

So far a not-active fullscreen X11 window was kept in the active layer if
the newly activated window is in the same group (that is same client
leader). For example a fullscreen X11 kwrite window is in the active layer
if another kwrite window is active. The two kwrite windows obviously
don't have anything to do with each other, but are in the same group.

This creates problems as it's not possible to raise other windows above
the active not-fullscreen kwrite window. E.g. the panel is stacked below.

The idea behind the check makes sense: if a fullscreen window opens
another window (e.g. a configuration dialog) it should not be put back
to normal layer. Thus the check is adjusted whether the new active
window is a transient to the fullscreen window. Thus the intention is
still the same, but does not cause the problems.

As the code now does not need to differentiate between X11 and Wayland
windows (group only on X11) the Client specific implementation is
removed and the method unvirtual'ed.

BUG: 388310
FIXED-IN: 5.12.0

Test Plan: Test passes

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #plasma

Differential Revision:
parent b002b279
......@@ -1152,7 +1152,7 @@ bool AbstractClient::isActiveFullScreen() const
// according to NETWM spec implementation notes suggests
// "focused windows having state _NET_WM_STATE_FULLSCREEN" to be on the highest layer.
// we'll also take the screen into account
return ac && (ac == this || ac->screen() != screen());
return ac && (ac == this || ac->screen() != screen()|| ac->allMainClients().contains(const_cast<AbstractClient*>(this)));
#define BORDER(which) \
......@@ -803,7 +803,7 @@ protected:
Layer belongsToLayer() const;
virtual bool belongsToDesktop() const;
void invalidateLayer();
virtual bool isActiveFullScreen() const;
bool isActiveFullScreen() const;
virtual Layer layerForDock() const;
// electric border / quick tiling
......@@ -593,8 +593,11 @@ void X11ClientTest::testFullscreenWindowGroups()
// first client should be moved back to normal layer
QCOMPARE(client->isActive(), false);
QCOMPARE(client->isFullScreen(), true);
QEXPECT_FAIL("", "BUG 388310", Continue);
QCOMPARE(client->layer(), NormalLayer);
// activating the fullscreen window again, should move it to active layer
QTRY_COMPARE(client->layer(), ActiveLayer);
......@@ -389,7 +389,6 @@ protected:
void doSetSkipPager() override;
void doSetSkipTaskbar() override;
bool belongsToDesktop() const override;
bool isActiveFullScreen() const override;
void setGeometryRestore(const QRect &geo) override;
void updateTabGroupStates(TabGroup::States states) override;
void doMove(int x, int y) override;
......@@ -819,19 +819,4 @@ bool rec_checkTransientOnTop(const QList<AbstractClient*> &transients, const Cli
return false;
bool Client::isActiveFullScreen() const
if (AbstractClient::isActiveFullScreen()) {
return true;
if (!isFullScreen())
return false;
const Client* ac = dynamic_cast<Client*>(workspace()->mostRecentlyActivatedClient()); // instead of activeClient() - avoids flicker
// according to NETWM spec implementation notes suggests
// "focused windows having state _NET_WM_STATE_FULLSCREEN" to be on the highest layer.
// we'll also take the screen into account
return ac && (this->group() == ac->group());
} // namespace
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment