diff --git a/autotests/integration/activities_test.cpp b/autotests/integration/activities_test.cpp index 4544b340a5..b8bcc54043 100644 --- a/autotests/integration/activities_test.cpp +++ b/autotests/integration/activities_test.cpp @@ -11,7 +11,6 @@ #include "activities.h" #include "core/output.h" #include "core/outputbackend.h" -#include "deleted.h" #include "pointer_input.h" #include "utils/xcbutils.h" #include "wayland_server.h" @@ -47,7 +46,6 @@ private: void ActivitiesTest::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); QVERIFY(waylandServer()->init(s_socketName)); QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(QVector, QVector() << QRect(0, 0, 1280, 1024) << QRect(1280, 0, 1280, 1024))); diff --git a/autotests/integration/dbus_interface_test.cpp b/autotests/integration/dbus_interface_test.cpp index 022b4c5deb..e4ee9e1b0c 100644 --- a/autotests/integration/dbus_interface_test.cpp +++ b/autotests/integration/dbus_interface_test.cpp @@ -12,7 +12,6 @@ #include "atoms.h" #include "core/outputbackend.h" -#include "deleted.h" #include "rules.h" #include "virtualdesktops.h" #include "wayland_server.h" @@ -54,7 +53,6 @@ private Q_SLOTS: void TestDbusInterface::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); diff --git a/autotests/integration/desktop_window_x11_test.cpp b/autotests/integration/desktop_window_x11_test.cpp index 31cb09bfef..b7c71bb168 100644 --- a/autotests/integration/desktop_window_x11_test.cpp +++ b/autotests/integration/desktop_window_x11_test.cpp @@ -10,7 +10,6 @@ #include "core/output.h" #include "core/outputbackend.h" -#include "deleted.h" #include "pointer_input.h" #include "utils/xcbutils.h" #include "wayland_server.h" @@ -42,7 +41,6 @@ private: void X11DesktopWindowTest::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); QVERIFY(waylandServer()->init(s_socketName)); QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(QVector, QVector() << QRect(0, 0, 1280, 1024) << QRect(1280, 0, 1280, 1024))); diff --git a/autotests/integration/dont_crash_cancel_animation.cpp b/autotests/integration/dont_crash_cancel_animation.cpp index e051904506..1a2c2a71ed 100644 --- a/autotests/integration/dont_crash_cancel_animation.cpp +++ b/autotests/integration/dont_crash_cancel_animation.cpp @@ -10,7 +10,6 @@ #include "composite.h" #include "core/outputbackend.h" -#include "deleted.h" #include "effectloader.h" #include "effects.h" #include "scripting/scriptedeffect.h" @@ -43,7 +42,6 @@ private Q_SLOTS: void DontCrashCancelAnimationFromAnimationEndedTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QVERIFY(waylandServer()->init(s_socketName)); QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(QVector, QVector() << QRect(0, 0, 1280, 1024) << QRect(1280, 0, 1280, 1024))); diff --git a/autotests/integration/dont_crash_glxgears.cpp b/autotests/integration/dont_crash_glxgears.cpp index cc1136f813..c44ef0e57a 100644 --- a/autotests/integration/dont_crash_glxgears.cpp +++ b/autotests/integration/dont_crash_glxgears.cpp @@ -9,7 +9,6 @@ #include "kwin_wayland_test.h" #include "core/outputbackend.h" -#include "deleted.h" #include "wayland_server.h" #include "window.h" #include "workspace.h" @@ -32,7 +31,7 @@ private Q_SLOTS: void DontCrashGlxgearsTest::initTestCase() { - qRegisterMetaType(); + qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); QVERIFY(waylandServer()->init(s_socketName)); QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(QVector, QVector() << QRect(0, 0, 1280, 1024) << QRect(1280, 0, 1280, 1024))); diff --git a/autotests/integration/dont_crash_reinitialize_compositor.cpp b/autotests/integration/dont_crash_reinitialize_compositor.cpp index 6015bdc710..7dd4249060 100644 --- a/autotests/integration/dont_crash_reinitialize_compositor.cpp +++ b/autotests/integration/dont_crash_reinitialize_compositor.cpp @@ -13,7 +13,6 @@ #include "core/output.h" #include "core/outputbackend.h" #include "core/renderbackend.h" -#include "deleted.h" #include "effectloader.h" #include "effects.h" #include "wayland_server.h" @@ -45,7 +44,6 @@ void DontCrashReinitializeCompositorTest::initTestCase() qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); QVERIFY(waylandServer()->init(s_socketName)); QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(QVector, QVector() << QRect(0, 0, 1280, 1024) << QRect(1280, 0, 1280, 1024))); diff --git a/autotests/integration/effects/popup_open_close_animation_test.cpp b/autotests/integration/effects/popup_open_close_animation_test.cpp index 2755cd6a54..11ea0bc26a 100644 --- a/autotests/integration/effects/popup_open_close_animation_test.cpp +++ b/autotests/integration/effects/popup_open_close_animation_test.cpp @@ -10,7 +10,6 @@ #include "kwin_wayland_test.h" #include "core/outputbackend.h" -#include "deleted.h" #include "effectloader.h" #include "effects.h" #include "internalwindow.h" @@ -48,7 +47,6 @@ void PopupOpenCloseAnimationTest::initTestCase() qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); qRegisterMetaType(); - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); QVERIFY(waylandServer()->init(s_socketName)); diff --git a/autotests/integration/effects/scripted_effects_test.cpp b/autotests/integration/effects/scripted_effects_test.cpp index ccaf4313fb..7db029de49 100644 --- a/autotests/integration/effects/scripted_effects_test.cpp +++ b/autotests/integration/effects/scripted_effects_test.cpp @@ -13,7 +13,6 @@ #include "core/outputbackend.h" #include "core/renderbackend.h" #include "cursor.h" -#include "deleted.h" #include "effectloader.h" #include "effects.h" #include "libkwineffects/anidata_p.h" @@ -127,7 +126,6 @@ bool ScriptedEffectWithDebugSpy::load(const QString &name) void ScriptedEffectsTest::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); QVERIFY(waylandServer()->init(s_socketName)); diff --git a/autotests/integration/effects/slidingpopups_test.cpp b/autotests/integration/effects/slidingpopups_test.cpp index 44e4a942a6..fcebefb7fd 100644 --- a/autotests/integration/effects/slidingpopups_test.cpp +++ b/autotests/integration/effects/slidingpopups_test.cpp @@ -10,7 +10,6 @@ #include "core/outputbackend.h" #include "core/renderbackend.h" #include "cursor.h" -#include "deleted.h" #include "effectloader.h" #include "effects.h" #include "kwin_wayland_test.h" @@ -49,7 +48,6 @@ void SlidingPopupsTest::initTestCase() { qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); qRegisterMetaType(); - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); QVERIFY(waylandServer()->init(s_socketName)); diff --git a/autotests/integration/effects/toplevel_open_close_animation_test.cpp b/autotests/integration/effects/toplevel_open_close_animation_test.cpp index c2cd3c85d5..dec991979d 100644 --- a/autotests/integration/effects/toplevel_open_close_animation_test.cpp +++ b/autotests/integration/effects/toplevel_open_close_animation_test.cpp @@ -12,7 +12,6 @@ #include "composite.h" #include "core/outputbackend.h" #include "core/renderbackend.h" -#include "deleted.h" #include "effectloader.h" #include "effects.h" #include "wayland_server.h" @@ -45,7 +44,6 @@ void ToplevelOpenCloseAnimationTest::initTestCase() qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); QVERIFY(waylandServer()->init(s_socketName)); QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(QVector, QVector() << QRect(0, 0, 1280, 1024) << QRect(1280, 0, 1280, 1024))); diff --git a/autotests/integration/input_stacking_order.cpp b/autotests/integration/input_stacking_order.cpp index 488ee2ad4d..16de4eefc3 100644 --- a/autotests/integration/input_stacking_order.cpp +++ b/autotests/integration/input_stacking_order.cpp @@ -10,7 +10,6 @@ #include "core/output.h" #include "core/outputbackend.h" -#include "deleted.h" #include "pointer_input.h" #include "wayland/seat_interface.h" #include "wayland_server.h" @@ -48,7 +47,6 @@ private: void InputStackingOrderTest::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); QVERIFY(waylandServer()->init(s_socketName)); QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(QVector, QVector() << QRect(0, 0, 1280, 1024) << QRect(1280, 0, 1280, 1024))); diff --git a/autotests/integration/inputmethod_test.cpp b/autotests/integration/inputmethod_test.cpp index 80506fa248..254b5a5b78 100644 --- a/autotests/integration/inputmethod_test.cpp +++ b/autotests/integration/inputmethod_test.cpp @@ -10,7 +10,6 @@ #include "core/output.h" #include "core/outputbackend.h" -#include "deleted.h" #include "effects.h" #include "inputmethod.h" #include "keyboard_input.h" @@ -79,7 +78,6 @@ void InputMethodTest::initTestCase() { QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.kwin.testvirtualkeyboard")); - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); diff --git a/autotests/integration/internal_window.cpp b/autotests/integration/internal_window.cpp index 1987ca88e5..a5b916ba74 100644 --- a/autotests/integration/internal_window.cpp +++ b/autotests/integration/internal_window.cpp @@ -10,7 +10,6 @@ #include "core/output.h" #include "core/outputbackend.h" -#include "deleted.h" #include "effects.h" #include "internalwindow.h" #include "pointer_input.h" @@ -171,7 +170,6 @@ void HelperWindow::keyReleaseEvent(QKeyEvent *event) void InternalWindowTest::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); QVERIFY(waylandServer()->init(s_socketName)); diff --git a/autotests/integration/move_resize_window_test.cpp b/autotests/integration/move_resize_window_test.cpp index b4a76734ef..74718ba774 100644 --- a/autotests/integration/move_resize_window_test.cpp +++ b/autotests/integration/move_resize_window_test.cpp @@ -13,7 +13,6 @@ #include "core/output.h" #include "core/outputbackend.h" #include "cursor.h" -#include "deleted.h" #include "effects.h" #include "placement.h" #include "pointer_input.h" @@ -82,7 +81,6 @@ private: void MoveResizeWindowTest::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); qRegisterMetaType("MaximizeMode"); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); QVERIFY(waylandServer()->init(s_socketName)); diff --git a/autotests/integration/pointer_input.cpp b/autotests/integration/pointer_input.cpp index c5a0b1a434..79c60bdb13 100644 --- a/autotests/integration/pointer_input.cpp +++ b/autotests/integration/pointer_input.cpp @@ -11,7 +11,6 @@ #include "core/output.h" #include "core/outputbackend.h" #include "cursor.h" -#include "deleted.h" #include "effects.h" #include "options.h" #include "pointer_input.h" @@ -132,7 +131,6 @@ private: void PointerInputTest::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); QVERIFY(waylandServer()->init(s_socketName)); QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(QVector, QVector() << QRect(0, 0, 1280, 1024) << QRect(1280, 0, 1280, 1024))); diff --git a/autotests/integration/screenedge_client_show_test.cpp b/autotests/integration/screenedge_client_show_test.cpp index ebd0b42c15..88b0414b1a 100644 --- a/autotests/integration/screenedge_client_show_test.cpp +++ b/autotests/integration/screenedge_client_show_test.cpp @@ -10,7 +10,6 @@ #include "core/output.h" #include "core/outputbackend.h" -#include "deleted.h" #include "pointer_input.h" #include "screenedge.h" #include "wayland_server.h" @@ -41,7 +40,6 @@ private Q_SLOTS: void ScreenEdgeClientShowTest::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); QVERIFY(waylandServer()->init(s_socketName)); QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(QVector, QVector() << QRect(0, 0, 1280, 1024) << QRect(1280, 0, 1280, 1024))); diff --git a/autotests/integration/stacking_order_test.cpp b/autotests/integration/stacking_order_test.cpp index 03153ed25a..31f95a0185 100644 --- a/autotests/integration/stacking_order_test.cpp +++ b/autotests/integration/stacking_order_test.cpp @@ -11,7 +11,6 @@ #include "atoms.h" #include "core/outputbackend.h" -#include "deleted.h" #include "main.h" #include "wayland_server.h" #include "window.h" @@ -53,7 +52,6 @@ private Q_SLOTS: void StackingOrderTest::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); QVERIFY(waylandServer()->init(s_socketName)); @@ -182,7 +180,7 @@ void StackingOrderTest::testRaiseTransient() struct WindowUnrefDeleter { - void operator()(Deleted *d) + void operator()(Window *d) { if (d != nullptr) { d->unref(); @@ -243,7 +241,7 @@ void StackingOrderTest::testDeletedTransient() QTRY_VERIFY(!transient2->isActive()); // Close the top-most transient. - connect(transient2, &Window::windowClosed, this, [](Window *original, Deleted *deleted) { + connect(transient2, &Window::windowClosed, this, [](Window *original, Window *deleted) { deleted->ref(); }); @@ -252,8 +250,8 @@ void StackingOrderTest::testDeletedTransient() transient2Surface.reset(); QVERIFY(windowClosedSpy.wait()); - std::unique_ptr deletedTransient( - windowClosedSpy.first().at(1).value()); + std::unique_ptr deletedTransient( + windowClosedSpy.first().at(1).value()); QVERIFY(deletedTransient.get()); // The deleted transient still has to be above its old parent (transient1). @@ -646,7 +644,7 @@ void StackingOrderTest::testDeletedGroupTransient() QCOMPARE(workspace()->stackingOrder(), (QList{leader, member1, member2, transient})); // Unmap the transient. - connect(transient, &X11Window::windowClosed, this, [](Window *original, Deleted *deleted) { + connect(transient, &X11Window::windowClosed, this, [](Window *original, Window *deleted) { deleted->ref(); }); @@ -655,8 +653,8 @@ void StackingOrderTest::testDeletedGroupTransient() xcb_flush(conn.get()); QVERIFY(windowClosedSpy.wait()); - std::unique_ptr deletedTransient( - windowClosedSpy.first().at(1).value()); + std::unique_ptr deletedTransient( + windowClosedSpy.first().at(1).value()); QVERIFY(deletedTransient.get()); // The transient has to be above each member of the window group. diff --git a/autotests/integration/struts_test.cpp b/autotests/integration/struts_test.cpp index 018d5a7799..fbf3cd022d 100644 --- a/autotests/integration/struts_test.cpp +++ b/autotests/integration/struts_test.cpp @@ -10,7 +10,6 @@ #include "core/output.h" #include "core/outputbackend.h" -#include "deleted.h" #include "pointer_input.h" #include "screenedge.h" #include "virtualdesktops.h" @@ -60,7 +59,6 @@ private: void StrutsTest::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); QVERIFY(waylandServer()->init(s_socketName)); QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(QVector, QVector() << QRect(0, 0, 1280, 1024) << QRect(1280, 0, 1280, 1024))); diff --git a/autotests/integration/window_rules_test.cpp b/autotests/integration/window_rules_test.cpp index 8ba767854d..b247fbe5aa 100644 --- a/autotests/integration/window_rules_test.cpp +++ b/autotests/integration/window_rules_test.cpp @@ -11,7 +11,6 @@ #include "atoms.h" #include "core/output.h" #include "core/outputbackend.h" -#include "deleted.h" #include "pointer_input.h" #include "rules.h" #include "wayland_server.h" @@ -40,7 +39,6 @@ private Q_SLOTS: void WindowRuleTest::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); QVERIFY(waylandServer()->init(s_socketName)); QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(QVector, QVector() << QRect(0, 0, 1280, 1024) << QRect(1280, 0, 1280, 1024))); diff --git a/autotests/integration/x11_window_test.cpp b/autotests/integration/x11_window_test.cpp index edf394ecaf..ccd9881a65 100644 --- a/autotests/integration/x11_window_test.cpp +++ b/autotests/integration/x11_window_test.cpp @@ -12,7 +12,6 @@ #include "composite.h" #include "core/outputbackend.h" #include "cursor.h" -#include "deleted.h" #include "effectloader.h" #include "effects.h" #include "wayland_server.h" @@ -62,7 +61,6 @@ void X11WindowTest::initTestCase_data() void X11WindowTest::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); QVERIFY(waylandServer()->init(s_socketName)); @@ -749,7 +747,7 @@ void X11WindowTest::testX11WindowId() QUuid deletedUuid; QCOMPARE(deletedUuid.isNull(), true); - connect(window, &X11Window::windowClosed, this, [&deletedUuid](Window *, Deleted *d) { + connect(window, &X11Window::windowClosed, this, [&deletedUuid](Window *, Window *d) { deletedUuid = d->internalId(); }); diff --git a/autotests/integration/xdgshellwindow_test.cpp b/autotests/integration/xdgshellwindow_test.cpp index 1ed97d0ec8..11940695f5 100644 --- a/autotests/integration/xdgshellwindow_test.cpp +++ b/autotests/integration/xdgshellwindow_test.cpp @@ -13,7 +13,6 @@ #include "core/outputbackend.h" #include "decorations/decorationbridge.h" #include "decorations/settings.h" -#include "deleted.h" #include "effects.h" #include "pointer_input.h" #include "virtualdesktops.h" @@ -160,7 +159,6 @@ void TestXdgShellWindow::testXdgWindowRepositioning() void TestXdgShellWindow::initTestCase() { - qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); diff --git a/autotests/integration/xwayland_input_test.cpp b/autotests/integration/xwayland_input_test.cpp index 49eba1850d..59f45f7c34 100644 --- a/autotests/integration/xwayland_input_test.cpp +++ b/autotests/integration/xwayland_input_test.cpp @@ -10,7 +10,6 @@ #include "core/output.h" #include "core/outputbackend.h" -#include "deleted.h" #include "pointer_input.h" #include "wayland/seat_interface.h" #include "wayland_server.h" @@ -40,7 +39,6 @@ private Q_SLOTS: void XWaylandInputTest::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); QSignalSpy applicationStartedSpy(kwinApp(), &Application::started); QVERIFY(waylandServer()->init(s_socketName)); QMetaObject::invokeMethod(kwinApp()->outputBackend(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(QVector, QVector() << QRect(0, 0, 1280, 1024) << QRect(1280, 0, 1280, 1024))); diff --git a/src/composite.cpp b/src/composite.cpp index 941237c080..b1bab319c0 100644 --- a/src/composite.cpp +++ b/src/composite.cpp @@ -20,7 +20,6 @@ #include "cursordelegate_qpainter.h" #include "dbusinterface.h" #include "decorations/decoratedclient.h" -#include "deleted.h" #include "effects.h" #include "ftrace.h" #include "internalwindow.h" diff --git a/src/deleted.cpp b/src/deleted.cpp index 28f6f8fd08..3426af9cfd 100644 --- a/src/deleted.cpp +++ b/src/deleted.cpp @@ -25,12 +25,7 @@ Deleted::Deleted() , m_frame(XCB_WINDOW_NONE) , m_layer(UnknownLayer) , m_shade(false) - , m_minimized(false) - , m_modal(false) - , m_wasClient(false) , m_fullscreen(false) - , m_keepAbove(false) - , m_keepBelow(false) , m_wasPopupWindow(false) , m_wasOutline(false) , m_wasLockScreen(false) @@ -80,16 +75,11 @@ void Deleted::copyToDeleted(Window *window) decoration_right, decoration_bottom); } - m_wasClient = true; - m_minimized = window->isMinimized(); - m_modal = window->isModal(); m_mainWindows = window->mainWindows(); for (Window *w : std::as_const(m_mainWindows)) { connect(w, &Window::windowClosed, this, &Deleted::mainWindowClosed); } m_fullscreen = window->isFullScreen(); - m_keepAbove = window->keepAbove(); - m_keepBelow = window->keepBelow(); m_caption = window->caption(); for (auto vd : std::as_const(m_desktops)) { diff --git a/src/deleted.h b/src/deleted.h index b08eab0fa2..cb1e594a5e 100644 --- a/src/deleted.h +++ b/src/deleted.h @@ -37,23 +37,11 @@ public: { return m_shade; } - bool isMinimized() const - { - return m_minimized; - } - bool isModal() const - { - return m_modal; - } QList mainWindows() const override { return m_mainWindows; } NET::WindowType windowType(bool direct = false, int supported_types = 0) const override; - bool wasClient() const - { - return m_wasClient; - } QString windowRole() const override; bool isFullScreen() const override @@ -61,20 +49,6 @@ public: return m_fullscreen; } - bool keepAbove() const - { - return m_keepAbove; - } - bool keepBelow() const - { - return m_keepBelow; - } - - QString caption() const - { - return m_caption; - } - QString captionNormal() const override { return m_caption; } QString captionSuffix() const override { return {}; } bool isCloseable() const override { return false; } @@ -147,15 +121,10 @@ private: QRectF decoration_bottom; Layer m_layer; bool m_shade; - bool m_minimized; - bool m_modal; QList m_mainWindows; - bool m_wasClient; NET::WindowType m_type = NET::Unknown; QString m_windowRole; bool m_fullscreen; - bool m_keepAbove; - bool m_keepBelow; QString m_caption; bool m_wasPopupWindow; bool m_wasOutline; diff --git a/src/effects.cpp b/src/effects.cpp index 1728ce8967..c4ce52e312 100644 --- a/src/effects.cpp +++ b/src/effects.cpp @@ -21,7 +21,6 @@ #include "core/renderbackend.h" #include "core/renderlayer.h" #include "cursor.h" -#include "deleted.h" #include "group.h" #include "input_event.h" #include "internalwindow.h" @@ -177,7 +176,7 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, WorkspaceScene *s connect(ws, &Workspace::windowActivated, this, [this](Window *window) { Q_EMIT windowActivated(window ? window->effectWindow() : nullptr); }); - connect(ws, &Workspace::deletedRemoved, this, [this](KWin::Deleted *d) { + connect(ws, &Workspace::deletedRemoved, this, [this](KWin::Window *d) { Q_EMIT windowDeleted(d->effectWindow()); elevated_windows.removeAll(d->effectWindow()); }); @@ -525,7 +524,7 @@ void EffectsHandlerImpl::slotUnmanagedShown(Window *window) Q_EMIT windowAdded(u->effectWindow()); } -void EffectsHandlerImpl::slotWindowClosed(Window *original, Deleted *d) +void EffectsHandlerImpl::slotWindowClosed(Window *original, Window *d) { original->disconnect(this); if (d) { @@ -1976,16 +1975,16 @@ const EffectWindowGroup *EffectWindowImpl::group() const void EffectWindowImpl::refWindow() { - if (auto d = static_cast(m_window->isDeleted() ? m_window : nullptr)) { - return d->ref(); + if (m_window->isDeleted()) { + return m_window->ref(); } Q_UNREACHABLE(); // TODO } void EffectWindowImpl::unrefWindow() { - if (auto d = static_cast(m_window->isDeleted() ? m_window : nullptr)) { - return d->unref(); // delays deletion in case + if (m_window->isDeleted()) { + return m_window->unref(); } Q_UNREACHABLE(); // TODO } @@ -2041,44 +2040,26 @@ WINDOW_HELPER(bool, isLockScreen, isLockScreen) WINDOW_HELPER(pid_t, pid, pid) WINDOW_HELPER(qlonglong, windowId, window) WINDOW_HELPER(QUuid, internalId, internalId) +WINDOW_HELPER(bool, isMinimized, isMinimized) +WINDOW_HELPER(bool, isModal, isModal) +WINDOW_HELPER(bool, isFullScreen, isFullScreen) +WINDOW_HELPER(bool, keepAbove, keepAbove) +WINDOW_HELPER(bool, keepBelow, keepBelow) +WINDOW_HELPER(QString, caption, caption) +WINDOW_HELPER(bool, isMovable, isMovable) +WINDOW_HELPER(bool, isMovableAcrossScreens, isMovableAcrossScreens) +WINDOW_HELPER(bool, isUserMove, isInteractiveMove) +WINDOW_HELPER(bool, isUserResize, isInteractiveResize) +WINDOW_HELPER(QRectF, iconGeometry, iconGeometry) +WINDOW_HELPER(bool, isSpecialWindow, isSpecialWindow) +WINDOW_HELPER(bool, acceptsFocus, wantsInput) +WINDOW_HELPER(QIcon, icon, icon) +WINDOW_HELPER(bool, isSkipSwitcher, skipSwitcher) +WINDOW_HELPER(bool, decorationHasAlpha, decorationHasAlpha) +WINDOW_HELPER(bool, isUnresponsive, unresponsive) #undef WINDOW_HELPER -// TODO: Merge Window and Deleted. -#define MANAGED_HELPER(rettype, prototype, propertyname, defaultValue) \ - rettype EffectWindowImpl::prototype() const \ - { \ - auto client = static_cast(m_window->isClient() ? m_window : nullptr); \ - if (client) { \ - return client->propertyname(); \ - } \ - auto deleted = static_cast(m_window->isDeleted() ? m_window : nullptr); \ - if (deleted) { \ - return deleted->propertyname(); \ - } \ - return defaultValue; \ - } - -MANAGED_HELPER(bool, isMinimized, isMinimized, false) -MANAGED_HELPER(bool, isModal, isModal, false) -MANAGED_HELPER(bool, isFullScreen, isFullScreen, false) -MANAGED_HELPER(bool, keepAbove, keepAbove, false) -MANAGED_HELPER(bool, keepBelow, keepBelow, false) -MANAGED_HELPER(QString, caption, caption, QString()); -MANAGED_HELPER(bool, isMovable, isMovable, false) -MANAGED_HELPER(bool, isMovableAcrossScreens, isMovableAcrossScreens, false) -MANAGED_HELPER(bool, isUserMove, isInteractiveMove, false) -MANAGED_HELPER(bool, isUserResize, isInteractiveResize, false) -MANAGED_HELPER(QRectF, iconGeometry, iconGeometry, QRectF()) -MANAGED_HELPER(bool, isSpecialWindow, isSpecialWindow, true) -MANAGED_HELPER(bool, acceptsFocus, wantsInput, true) // We don't actually know... -MANAGED_HELPER(QIcon, icon, icon, QIcon()) -MANAGED_HELPER(bool, isSkipSwitcher, skipSwitcher, false) -MANAGED_HELPER(bool, decorationHasAlpha, decorationHasAlpha, false) -MANAGED_HELPER(bool, isUnresponsive, unresponsive, false) - -#undef MANAGED_HELPER - QVector EffectWindowImpl::desktops() const { const auto desks = m_window->desktops(); @@ -2193,15 +2174,7 @@ EffectWindowList getMainWindows(T *c) EffectWindowList EffectWindowImpl::mainWindows() const { - if (auto client = static_cast(m_window->isClient() ? m_window : nullptr)) { - return getMainWindows(client); - } - - if (auto deleted = static_cast(m_window->isDeleted() ? m_window : nullptr)) { - return getMainWindows(deleted); - } - - return {}; + return getMainWindows(m_window); } void EffectWindowImpl::setData(int role, const QVariant &data) diff --git a/src/effects.h b/src/effects.h index f95d9f261c..e78601e3c7 100644 --- a/src/effects.h +++ b/src/effects.h @@ -35,7 +35,6 @@ namespace KWin { class Window; class Compositor; -class Deleted; class EffectLoader; class Group; class Unmanaged; @@ -274,7 +273,7 @@ public Q_SLOTS: protected Q_SLOTS: void slotWindowShown(KWin::Window *); void slotUnmanagedShown(KWin::Window *); - void slotWindowClosed(KWin::Window *original, KWin::Deleted *d); + void slotWindowClosed(KWin::Window *original, KWin::Window *d); void slotOpacityChanged(KWin::Window *window, qreal oldOpacity); void slotClientModalityChanged(); void slotWindowDamaged(KWin::Window *window); diff --git a/src/idle_inhibition.cpp b/src/idle_inhibition.cpp index 6271d5bcca..fd2b8c28c8 100644 --- a/src/idle_inhibition.cpp +++ b/src/idle_inhibition.cpp @@ -8,7 +8,6 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "idle_inhibition.h" -#include "deleted.h" #include "input.h" #include "virtualdesktops.h" #include "wayland/surface_interface.h" diff --git a/src/inputmethod.cpp b/src/inputmethod.cpp index 46b95a8e62..d2c7769036 100644 --- a/src/inputmethod.cpp +++ b/src/inputmethod.cpp @@ -21,7 +21,6 @@ #if KWIN_BUILD_SCREENLOCKER #include "screenlockerwatcher.h" #endif -#include "deleted.h" #include "tablet_input.h" #include "touch_input.h" #include "wayland/display.h" diff --git a/src/keyboard_layout_switching.cpp b/src/keyboard_layout_switching.cpp index e5faa1f210..c51458be05 100644 --- a/src/keyboard_layout_switching.cpp +++ b/src/keyboard_layout_switching.cpp @@ -7,7 +7,6 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "keyboard_layout_switching.h" -#include "deleted.h" #include "keyboard_layout.h" #include "virtualdesktops.h" #include "window.h" diff --git a/src/layers.cpp b/src/layers.cpp index 1c542188ff..63cd500802 100644 --- a/src/layers.cpp +++ b/src/layers.cpp @@ -65,7 +65,6 @@ */ #include "composite.h" -#include "deleted.h" #include "effects.h" #include "focuschain.h" #include "group.h" diff --git a/src/plugins/screencast/screencastmanager.cpp b/src/plugins/screencast/screencastmanager.cpp index e72277e343..54b28d7e49 100644 --- a/src/plugins/screencast/screencastmanager.cpp +++ b/src/plugins/screencast/screencastmanager.cpp @@ -10,7 +10,6 @@ #include "composite.h" #include "core/output.h" #include "core/outputbackend.h" -#include "deleted.h" #include "effects.h" #include "kwingltexture.h" #include "outputscreencastsource.h" diff --git a/src/plugins/screencast/windowscreencastsource.cpp b/src/plugins/screencast/windowscreencastsource.cpp index 7e66412802..31fe5d746f 100644 --- a/src/plugins/screencast/windowscreencastsource.cpp +++ b/src/plugins/screencast/windowscreencastsource.cpp @@ -10,7 +10,6 @@ #include "composite.h" #include "core/output.h" #include "core/renderloop.h" -#include "deleted.h" #include "effects.h" #include "libkwineffects/kwineffects.h" #include "libkwineffects/kwingltexture.h" diff --git a/src/popup_input_filter.cpp b/src/popup_input_filter.cpp index 43c2028c5d..e57dbb059e 100644 --- a/src/popup_input_filter.cpp +++ b/src/popup_input_filter.cpp @@ -5,7 +5,6 @@ */ #include "popup_input_filter.h" -#include "deleted.h" #include "input_event.h" #include "internalwindow.h" #include "wayland/seat_interface.h" diff --git a/src/scene/decorationitem.cpp b/src/scene/decorationitem.cpp index 9ef6510965..ea3d68c197 100644 --- a/src/scene/decorationitem.cpp +++ b/src/scene/decorationitem.cpp @@ -9,7 +9,6 @@ #include "composite.h" #include "core/output.h" #include "decorations/decoratedclient.h" -#include "deleted.h" #include "scene/workspacescene.h" #include @@ -166,7 +165,7 @@ void DecorationItem::handleFrameGeometryChanged() setSize(m_window->size().toSize()); } -void DecorationItem::handleWindowClosed(Window *original, Deleted *deleted) +void DecorationItem::handleWindowClosed(Window *original, Window *deleted) { m_window = deleted; diff --git a/src/scene/decorationitem.h b/src/scene/decorationitem.h index af743e5156..466aa18297 100644 --- a/src/scene/decorationitem.h +++ b/src/scene/decorationitem.h @@ -17,7 +17,6 @@ namespace KWin { class Window; -class Deleted; class Output; namespace Decoration @@ -88,7 +87,7 @@ public: private Q_SLOTS: void handleFrameGeometryChanged(); - void handleWindowClosed(Window *original, Deleted *deleted); + void handleWindowClosed(Window *original, Window *deleted); void handleOutputChanged(); void handleOutputScaleChanged(); diff --git a/src/scene/shadowitem.cpp b/src/scene/shadowitem.cpp index 8e25d8c0c1..1b3727a559 100644 --- a/src/scene/shadowitem.cpp +++ b/src/scene/shadowitem.cpp @@ -6,7 +6,6 @@ #include "scene/shadowitem.h" #include "composite.h" -#include "deleted.h" #include "scene/workspacescene.h" #include "shadow.h" @@ -68,7 +67,7 @@ void ShadowItem::handleTextureChanged() m_textureDirty = true; } -void ShadowItem::handleWindowClosed(Window *original, Deleted *deleted) +void ShadowItem::handleWindowClosed(Window *original, Window *deleted) { m_window = deleted; } diff --git a/src/scene/shadowitem.h b/src/scene/shadowitem.h index 575cfc7f3a..e96393f774 100644 --- a/src/scene/shadowitem.h +++ b/src/scene/shadowitem.h @@ -11,7 +11,6 @@ namespace KWin { -class Deleted; class Shadow; class Window; @@ -50,7 +49,7 @@ protected: private Q_SLOTS: void handleTextureChanged(); void updateGeometry(); - void handleWindowClosed(Window *original, Deleted *deleted); + void handleWindowClosed(Window *original, Window *deleted); private: Window *m_window; diff --git a/src/scene/surfaceitem_internal.cpp b/src/scene/surfaceitem_internal.cpp index 96f1b12a42..beb6255824 100644 --- a/src/scene/surfaceitem_internal.cpp +++ b/src/scene/surfaceitem_internal.cpp @@ -7,7 +7,6 @@ #include "scene/surfaceitem_internal.h" #include "composite.h" #include "core/renderbackend.h" -#include "deleted.h" #include "internalwindow.h" #include @@ -55,7 +54,7 @@ void SurfaceItemInternal::handleBufferGeometryChanged(const QRectF &old) setSize(m_window->bufferGeometry().size()); } -void SurfaceItemInternal::handleWindowClosed(Window *original, Deleted *deleted) +void SurfaceItemInternal::handleWindowClosed(Window *original, Window *deleted) { m_window = deleted; } diff --git a/src/scene/surfaceitem_internal.h b/src/scene/surfaceitem_internal.h index d4bfb1c827..e2f53ea3c8 100644 --- a/src/scene/surfaceitem_internal.h +++ b/src/scene/surfaceitem_internal.h @@ -13,7 +13,6 @@ class QOpenGLFramebufferObject; namespace KWin { -class Deleted; class InternalWindow; /** @@ -32,7 +31,7 @@ public: private Q_SLOTS: void handleBufferGeometryChanged(const QRectF &old); - void handleWindowClosed(Window *original, Deleted *deleted); + void handleWindowClosed(Window *original, Window *deleted); protected: std::unique_ptr createPixmap() override; diff --git a/src/scene/surfaceitem_wayland.cpp b/src/scene/surfaceitem_wayland.cpp index 66d1063a28..be4a007c84 100644 --- a/src/scene/surfaceitem_wayland.cpp +++ b/src/scene/surfaceitem_wayland.cpp @@ -7,10 +7,10 @@ #include "scene/surfaceitem_wayland.h" #include "composite.h" #include "core/renderbackend.h" -#include "deleted.h" #include "wayland/clientbuffer.h" #include "wayland/subcompositor_interface.h" #include "wayland/surface_interface.h" +#include "window.h" namespace KWin { @@ -222,7 +222,7 @@ QVector SurfaceItemXwayland::shape() const return shape; } -void SurfaceItemXwayland::handleWindowClosed(Window *original, Deleted *deleted) +void SurfaceItemXwayland::handleWindowClosed(Window *original, Window *deleted) { m_window = deleted; } diff --git a/src/scene/surfaceitem_wayland.h b/src/scene/surfaceitem_wayland.h index 1d279deb74..e358972c3a 100644 --- a/src/scene/surfaceitem_wayland.h +++ b/src/scene/surfaceitem_wayland.h @@ -18,8 +18,6 @@ class SurfaceInterface; namespace KWin { -class Deleted; - /** * The SurfaceItemWayland class represents a Wayland surface in the scene. */ @@ -92,7 +90,7 @@ public: QVector shape() const override; private: - void handleWindowClosed(Window *original, Deleted *deleted); + void handleWindowClosed(Window *original, Window *deleted); Window *m_window; }; diff --git a/src/scene/surfaceitem_x11.cpp b/src/scene/surfaceitem_x11.cpp index dbec0b88a1..be6504e769 100644 --- a/src/scene/surfaceitem_x11.cpp +++ b/src/scene/surfaceitem_x11.cpp @@ -7,8 +7,8 @@ #include "scene/surfaceitem_x11.h" #include "composite.h" #include "core/renderbackend.h" -#include "deleted.h" #include "x11syncmanager.h" +#include "x11window.h" namespace KWin { @@ -49,7 +49,7 @@ Window *SurfaceItemX11::window() const return m_window; } -void SurfaceItemX11::handleWindowClosed(Window *original, Deleted *deleted) +void SurfaceItemX11::handleWindowClosed(Window *original, Window *deleted) { m_window = deleted; } diff --git a/src/scene/surfaceitem_x11.h b/src/scene/surfaceitem_x11.h index f01a39e263..4fc27f9e2e 100644 --- a/src/scene/surfaceitem_x11.h +++ b/src/scene/surfaceitem_x11.h @@ -14,8 +14,6 @@ namespace KWin { -class Deleted; - /** * The SurfaceItemX11 class represents an X11 surface in the scene. */ @@ -42,7 +40,7 @@ public: private Q_SLOTS: void handleBufferGeometryChanged(const QRectF &old); void handleGeometryShapeChanged(); - void handleWindowClosed(Window *original, Deleted *deleted); + void handleWindowClosed(Window *original, Window *deleted); protected: std::unique_ptr createPixmap() override; diff --git a/src/scene/windowitem.cpp b/src/scene/windowitem.cpp index 28373bb5b0..3659d6543d 100644 --- a/src/scene/windowitem.cpp +++ b/src/scene/windowitem.cpp @@ -5,7 +5,6 @@ */ #include "scene/windowitem.h" -#include "deleted.h" #include "internalwindow.h" #include "scene/decorationitem.h" #include "scene/shadowitem.h" @@ -125,7 +124,7 @@ void WindowItem::unrefVisible(int reason) updateVisibility(); } -void WindowItem::handleWindowClosed(Window *original, Deleted *deleted) +void WindowItem::handleWindowClosed(Window *original, Window *deleted) { m_window = deleted; } diff --git a/src/scene/windowitem.h b/src/scene/windowitem.h index 329388a33d..1971f9e29d 100644 --- a/src/scene/windowitem.h +++ b/src/scene/windowitem.h @@ -17,7 +17,6 @@ namespace KWin { class Window; class DecorationItem; -class Deleted; class InternalWindow; class Shadow; class ShadowItem; @@ -57,7 +56,7 @@ protected: void updateSurfaceItem(SurfaceItem *surfaceItem); private Q_SLOTS: - void handleWindowClosed(Window *original, Deleted *deleted); + void handleWindowClosed(Window *original, Window *deleted); void updateDecorationItem(); void updateShadowItem(); void updateSurfacePosition(); diff --git a/src/scene/workspacescene.cpp b/src/scene/workspacescene.cpp index 9cf05c3632..f44174145d 100644 --- a/src/scene/workspacescene.cpp +++ b/src/scene/workspacescene.cpp @@ -57,7 +57,6 @@ #include "core/output.h" #include "core/renderlayer.h" #include "core/renderloop.h" -#include "deleted.h" #include "effects.h" #include "internalwindow.h" #include "libkwineffects/renderviewport.h" diff --git a/src/window.cpp b/src/window.cpp index 6beaa773fa..7b8def3df9 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -220,6 +220,10 @@ void Window::copyToDeleted(Window *c) m_shapeRegionIsValid = c->m_shapeRegionIsValid; m_shapeRegion = c->m_shapeRegion; m_stackingOrder = c->m_stackingOrder; + m_minimized = c->m_minimized; + m_modal = c->m_modal; + m_keepAbove = c->m_keepAbove; + m_keepBelow = c->m_keepBelow; } // before being deleted, remove references to everything that's now diff --git a/src/window.h b/src/window.h index 79980b0ebe..df2a5ec538 100644 --- a/src/window.h +++ b/src/window.h @@ -49,7 +49,6 @@ namespace KWin class Group; class Output; class ClientMachine; -class Deleted; class EffectWindowImpl; class Tile; class Scene; @@ -1409,7 +1408,7 @@ Q_SIGNALS: void damaged(KWin::Window *window); void inputTransformationChanged(); void geometryShapeChanged(const QRectF &old); - void windowClosed(KWin::Window *window, KWin::Deleted *deleted); + void windowClosed(KWin::Window *window, KWin::Window *deleted); void windowShown(KWin::Window *window); void windowHidden(KWin::Window *window); /** diff --git a/src/workspace.cpp b/src/workspace.cpp index ab836380a3..63bf4b6359 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -25,7 +25,6 @@ #include "core/outputconfiguration.h" #include "cursor.h" #include "dbusinterface.h" -#include "deleted.h" #include "effects.h" #include "focuschain.h" #include "group.h" @@ -642,7 +641,7 @@ void Workspace::addToStack(Window *window) } } -void Workspace::replaceInStack(Window *original, Deleted *deleted) +void Workspace::replaceInStack(Window *original, Window *deleted) { const int unconstraintedIndex = unconstrained_stacking_order.indexOf(original); if (unconstraintedIndex != -1) { @@ -793,22 +792,19 @@ void Workspace::removeUnmanaged(Unmanaged *window) Q_EMIT unmanagedRemoved(window); } -void Workspace::addDeleted(Deleted *c, Window *orig) +void Workspace::addDeleted(Window *c, Window *orig) { Q_ASSERT(!deleted.contains(c)); deleted.append(c); replaceInStack(orig, c); } -void Workspace::removeDeleted(Deleted *c) +void Workspace::removeDeleted(Window *c) { Q_ASSERT(deleted.contains(c)); Q_EMIT deletedRemoved(c); deleted.removeAll(c); removeFromStack(c); - if (!c->wasClient()) { - return; - } if (X11Compositor *compositor = X11Compositor::self()) { compositor->updateClientCompositeBlocking(); } diff --git a/src/workspace.h b/src/workspace.h index 80b4b1ab21..3c04bcbd41 100644 --- a/src/workspace.h +++ b/src/workspace.h @@ -54,7 +54,6 @@ class Window; class Output; class ColorMapper; class Compositor; -class Deleted; class Group; class InternalWindow; class KillWindow; @@ -259,7 +258,7 @@ public: /** * @return List of deleted "windows" currently managed by Workspace */ - const QList &deletedList() const + const QList &deletedList() const { return deleted; } @@ -384,8 +383,8 @@ public: int unconstainedStackingOrderIndex(const X11Window *c) const; void removeUnmanaged(Unmanaged *); // Only called from Unmanaged::release() - void removeDeleted(Deleted *); - void addDeleted(Deleted *, Window *); + void removeDeleted(Window *); + void addDeleted(Window *, Window *); bool checkStartupNotification(xcb_window_t w, KStartupInfoId &id, KStartupInfoData &data); @@ -583,7 +582,7 @@ Q_SIGNALS: void groupAdded(KWin::Group *); void unmanagedAdded(KWin::Unmanaged *); void unmanagedRemoved(KWin::Unmanaged *); - void deletedRemoved(KWin::Deleted *); + void deletedRemoved(KWin::Window *); void configChanged(); void showingDesktopChanged(bool showing, bool animated); void outputOrderChanged(); @@ -628,7 +627,7 @@ private: void fixPositionAfterCrash(xcb_window_t w, const xcb_get_geometry_reply_t *geom); void saveOldScreenSizes(); void addToStack(Window *window); - void replaceInStack(Window *original, Deleted *deleted); + void replaceInStack(Window *original, Window *deleted); void removeFromStack(Window *window); /// This is the right way to create a new X11 window @@ -691,7 +690,7 @@ private: QList m_x11Clients; QList m_allClients; QList m_unmanaged; - QList deleted; + QList deleted; QList m_internalWindows; QList unconstrained_stacking_order; // Topmost last