[Wayland] Send stacking order event through plasma window management protocol

Summary: Depends on: D29054

Reviewers: zzag, davidedmundson, meven

Reviewed By: davidedmundson, meven

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29055
This commit is contained in:
Benjamin Port 2020-04-21 16:52:20 +02:00
parent 028aecaaf9
commit 750dd068e5
2 changed files with 22 additions and 5 deletions

View file

@ -864,6 +864,13 @@ public:
*/ */
virtual bool supportsWindowRules() const; virtual bool supportsWindowRules() const;
/**
* Return window management interface
*/
KWayland::Server::PlasmaWindowInterface *windowManagementInterface() const {
return m_windowManagementInterface;
}
public Q_SLOTS: public Q_SLOTS:
virtual void closeWindow() = 0; virtual void closeWindow() = 0;
@ -998,10 +1005,6 @@ protected:
m_quickTileMode = newMode; m_quickTileMode = newMode;
} }
KWayland::Server::PlasmaWindowInterface *windowManagementInterface() const {
return m_windowManagementInterface;
}
// geometry handling // geometry handling
void checkOffscreenPosition(QRect *geom, const QRect &screenArea); void checkOffscreenPosition(QRect *geom, const QRect &screenArea);
int borderLeft() const; int borderLeft() const;

View file

@ -404,7 +404,6 @@ bool WaylandServer::init(const QByteArray &socketName, InitializationFlags flags
} }
); );
m_virtualDesktopManagement = m_display->createPlasmaVirtualDesktopManagement(m_display); m_virtualDesktopManagement = m_display->createPlasmaVirtualDesktopManagement(m_display);
m_virtualDesktopManagement->create(); m_virtualDesktopManagement->create();
m_windowManagement->setPlasmaVirtualDesktopManagementInterface(m_virtualDesktopManagement); m_windowManagement->setPlasmaVirtualDesktopManagementInterface(m_virtualDesktopManagement);
@ -490,6 +489,21 @@ void WaylandServer::initWorkspace()
); );
} }
); );
connect(workspace(), &Workspace::workspaceInitialized, this, [this] {
auto f = [this] () {
QVector<quint32> ids;
for (Toplevel *toplevel : workspace()->stackingOrder()) {
auto *client = qobject_cast<AbstractClient *>(toplevel);
if (client && client->windowManagementInterface()) {
ids << client->windowManagementInterface()->internalId();
}
}
m_windowManagement->setStackingOrder(ids);
};
f();
connect(workspace(), &Workspace::stackingOrderChanged, this, f);
});
} }
if (hasScreenLockerIntegration()) { if (hasScreenLockerIntegration()) {