[plasma/kwin] src: utils: Drop unused SubSurfaceMonitor

Vlad Zahorodnii <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 582f24f34944d68eddb6b9a1b4489961e6db4422 by Vlad Zahorodnii.
Committed on 27/07/2026 at 12:05.
Pushed by vladz into branch 'master'.

utils: Drop unused SubSurfaceMonitor

M  +0    -1    src/CMakeLists.txt
M  +0    -1    src/utils/CMakeLists.txt
D  +0    -85   src/utils/subsurfacemonitor.cpp
D  +0    -73   src/utils/subsurfacemonitor.h

https://invent.kde.org/plasma/kwin/-/commit/582f24f34944d68eddb6b9a1b4489961e6db4422

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index fd112413e57..0afa4080bee 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -605,7 +605,6 @@ install(FILES
     utils/resource.h
     utils/serial.h
     utils/softwarevsyncmonitor.h
-    utils/subsurfacemonitor.h
     utils/udev.h
     utils/version.h
     utils/vsyncmonitor.h
diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt
index 30c0822e738..3868e05dbe2 100644
--- a/src/utils/CMakeLists.txt
+++ b/src/utils/CMakeLists.txt
@@ -11,7 +11,6 @@ target_sources(kwin PRIVATE
     ramfile.cpp
     realtime.cpp
     softwarevsyncmonitor.cpp
-    subsurfacemonitor.cpp
     udev.cpp
     vsyncmonitor.cpp
 )
diff --git a/src/utils/subsurfacemonitor.cpp b/src/utils/subsurfacemonitor.cpp
deleted file mode 100644
index 76d80f63aeb..00000000000
--- a/src/utils/subsurfacemonitor.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-    KWin - the KDE window manager
-    This file is part of the KDE project.
-
-    SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <[email protected]>
-
-    SPDX-License-Identifier: GPL-2.0-or-later
-*/
-
-#include "subsurfacemonitor.h"
-
-#include "wayland/subcompositor.h"
-#include "wayland/surface.h"
-
-namespace KWin
-{
-
-SubSurfaceMonitor::SubSurfaceMonitor(SurfaceInterface *surface, QObject *parent)
-    : QObject(parent)
-{
-    registerSurface(surface);
-}
-
-void SubSurfaceMonitor::registerSubSurface(SubSurfaceInterface *subSurface)
-{
-    SurfaceInterface *surface = subSurface->surface();
-
-    connect(subSurface, &SubSurfaceInterface::positionChanged,
-            this, &SubSurfaceMonitor::subSurfaceMoved);
-    connect(surface, &SurfaceInterface::sizeChanged,
-            this, &SubSurfaceMonitor::subSurfaceResized);
-    connect(surface, &SurfaceInterface::mapped,
-            this, &SubSurfaceMonitor::subSurfaceMapped);
-    connect(surface, &SurfaceInterface::unmapped,
-            this, &SubSurfaceMonitor::subSurfaceUnmapped);
-    connect(surface, &SurfaceInterface::committed,
-            this, [this, subSurface]() {
-        Q_EMIT subSurfaceCommitted(subSurface);
-    });
-
-    registerSurface(surface);
-}
-
-void SubSurfaceMonitor::unregisterSubSurface(SubSurfaceInterface *subSurface)
-{
-    SurfaceInterface *surface = subSurface->surface();
-    if (!surface) {
-        return;
-    }
-
-    disconnect(subSurface, nullptr, this, nullptr);
-
-    unregisterSurface(surface);
-}
-
-void SubSurfaceMonitor::registerSurface(SurfaceInterface *surface)
-{
-    connect(surface, &SurfaceInterface::childSubSurfaceAdded,
-            this, &SubSurfaceMonitor::subSurfaceAdded);
-    connect(surface, &SurfaceInterface::childSubSurfaceRemoved,
-            this, &SubSurfaceMonitor::subSurfaceRemoved);
-    connect(surface, &SurfaceInterface::childSubSurfaceAdded,
-            this, &SubSurfaceMonitor::registerSubSurface);
-    connect(surface, &SurfaceInterface::childSubSurfaceRemoved,
-            this, &SubSurfaceMonitor::unregisterSubSurface);
-
-    const QList<SubSurfaceInterface *> below = surface->below();
-    for (SubSurfaceInterface *childSubSurface : below) {
-        registerSubSurface(childSubSurface);
-    }
-
-    const QList<SubSurfaceInterface *> above = surface->above();
-    for (SubSurfaceInterface *childSubSurface : above) {
-        registerSubSurface(childSubSurface);
-    }
-}
-
-void SubSurfaceMonitor::unregisterSurface(SurfaceInterface *surface)
-{
-    disconnect(surface, nullptr, this, nullptr);
-}
-
-} // namespace KWin
-
-#include "moc_subsurfacemonitor.cpp"
diff --git a/src/utils/subsurfacemonitor.h b/src/utils/subsurfacemonitor.h
deleted file mode 100644
index 110294e676d..00000000000
--- a/src/utils/subsurfacemonitor.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-    KWin - the KDE window manager
-    This file is part of the KDE project.
-
-    SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <[email protected]>
-
-    SPDX-License-Identifier: GPL-2.0-or-later
-*/
-
-#pragma once
-
-#include <QObject>
-
-namespace KWin
-{
-
-class SurfaceInterface;
-class SubSurfaceInterface;
-
-}
-
-namespace KWin
-{
-
-/**
- * The SubSurfaceMonitor class provides a convenient way for monitoring changes in
- * sub-surface trees, e.g. addition or removal of sub-surfaces, etc.
- */
-class SubSurfaceMonitor : public QObject
-{
-    Q_OBJECT
-
-public:
-    /**
-     * Constructs a SubSurfaceTreeMonitor with the given @a surface and @a parent.
-     */
-    SubSurfaceMonitor(SurfaceInterface *surface, QObject *parent);
-
-Q_SIGNALS:
-    /**
-     * This signal is emitted when a new sub-surface has been added to the tree.
-     */
-    void subSurfaceAdded();
-    /**
-     * This signal is emitted when a sub-surface has been removed from the tree.
-     */
-    void subSurfaceRemoved();
-    /**
-     * This signal is emitted when a sub-surface has been moved relative to its parent.
-     */
-    void subSurfaceMoved();
-    /**
-     * This signal is emitted when a sub-surface has been resized.
-     */
-    void subSurfaceResized();
-    /**
-     * This signal is emitted when a sub-surface is mapped.
-     */
-    void subSurfaceMapped();
-    /**
-     * This signal is emitted when a sub-surface is unmapped.
-     */
-    void subSurfaceUnmapped();
-    void subSurfaceCommitted(SubSurfaceInterface *subSurface);
-
-private:
-    void registerSubSurface(SubSurfaceInterface *subSurface);
-    void unregisterSubSurface(SubSurfaceInterface *subSurface);
-    void registerSurface(SurfaceInterface *surface);
-    void unregisterSurface(SurfaceInterface *surface);
-};
-
-} // namespace KWin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.