diff --git a/abstract_client.h b/abstract_client.h --- a/abstract_client.h +++ b/abstract_client.h @@ -787,6 +787,7 @@ * Implementing subclasses can perform a windowing system solution for terminating. */ virtual void killWindow() = 0; + virtual void destroyClient() = 0; enum class SameApplicationCheck { RelaxedForActive = 1 << 0, diff --git a/internal_client.h b/internal_client.h --- a/internal_client.h +++ b/internal_client.h @@ -81,8 +81,8 @@ 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 fbo); void present(const QImage &image, const QRegion &damage); QWindow *internalWindow() const; diff --git a/workspace.cpp b/workspace.cpp --- a/workspace.cpp +++ b/workspace.cpp @@ -56,7 +56,6 @@ #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 @@ X11Client::cleanupX11(); if (waylandServer()) { - // TODO: Introduce AbstractClient::destroy(). const QList shellClients = waylandServer()->clients(); for (AbstractClient *client : shellClients) { - if (XdgShellClient *shellClient = qobject_cast(client)) { - shellClient->destroyClient(); - } + client->destroyClient(); } } diff --git a/x11client.h b/x11client.h --- a/x11client.h +++ b/x11client.h @@ -129,7 +129,7 @@ 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); diff --git a/xdgshellclient.h b/xdgshellclient.h --- a/xdgshellclient.h +++ b/xdgshellclient.h @@ -121,6 +121,7 @@ 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 @@ */ void finishInit(); void createDecoration(const QRect &oldgeom); - void destroyClient(); void createWindowId(); void updateIcon(); bool shouldExposeToWindowManagement();