Commit 86188389 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

Introduce AbstractClient::destroyClient()

Summary:
The new method provides a generic way for destructing clients. Notice
that we can't just delete clients because we may need to discard
temporary window rules, which is usually done in destroyClient().

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27821
parent be759b7d
......@@ -787,6 +787,7 @@ public:
* Implementing subclasses can perform a windowing system solution for terminating.
*/
virtual void killWindow() = 0;
virtual void destroyClient() = 0;
enum class SameApplicationCheck {
RelaxedForActive = 1 << 0,
......
......@@ -81,8 +81,8 @@ public:
void updateDecoration(bool check_workspace_pos, bool force = false) override;
void updateColorScheme() override;
void showOnScreenEdge() override;
void destroyClient() override;
void destroyClient();
void present(const QSharedPointer<QOpenGLFramebufferObject> fbo);
void present(const QImage &image, const QRegion &damage);
QWindow *internalWindow() const;
......
......@@ -56,7 +56,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "unmanaged.h"
#include "useractions.h"
#include "virtualdesktops.h"
#include "xdgshellclient.h"
#include "was_user_interaction_x11_filter.h"
#include "wayland_server.h"
#include "xcbutils.h"
......@@ -473,12 +472,9 @@ Workspace::~Workspace()
X11Client::cleanupX11();
if (waylandServer()) {
// TODO: Introduce AbstractClient::destroy().
const QList<AbstractClient *> shellClients = waylandServer()->clients();
for (AbstractClient *client : shellClients) {
if (XdgShellClient *shellClient = qobject_cast<XdgShellClient *>(client)) {
shellClient->destroyClient();
}
client->destroyClient();
}
}
......
......@@ -129,7 +129,7 @@ public:
bool manage(xcb_window_t w, bool isMapped);
void releaseWindow(bool on_shutdown = false);
void destroyClient();
void destroyClient() override;
QStringList activities() const override;
void setOnActivity(const QString &activity, bool enable);
......
......@@ -121,6 +121,7 @@ public:
void killWindow() override;
bool isLocalhost() const override;
bool supportsWindowRules() const override;
void destroyClient() override;
void installPlasmaShellSurface(KWayland::Server::PlasmaShellSurfaceInterface *surface);
void installServerSideDecoration(KWayland::Server::ServerSideDecorationInterface *decoration);
......@@ -170,7 +171,6 @@ private:
*/
void finishInit();
void createDecoration(const QRect &oldgeom);
void destroyClient();
void createWindowId();
void updateIcon();
bool shouldExposeToWindowManagement();
......
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