diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -418,7 +418,6 @@ options.cpp outline.cpp events.cpp - killwindow.cpp geometrytip.cpp screens.cpp outputscreens.cpp diff --git a/killwindow.h b/killwindow.h deleted file mode 100644 --- a/killwindow.h +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 1999, 2000 Matthias Ettrich -Copyright (C) 2003 Lubos Lunak -Copyright (C) 2012 Martin Gräßlin - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*********************************************************************/ - -#ifndef KWIN_KILLWINDOW_H -#define KWIN_KILLWINDOW_H - -namespace KWin -{ - -class KillWindow -{ -public: - - KillWindow(); - ~KillWindow(); - - void start(); -}; - -} // namespace - -#endif diff --git a/killwindow.cpp b/killwindow.cpp deleted file mode 100644 --- a/killwindow.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 1999, 2000 Matthias Ettrich -Copyright (C) 2003 Lubos Lunak -Copyright (C) 2012 Martin Gräßlin - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*********************************************************************/ -#include "killwindow.h" -#include "abstract_client.h" -#include "main.h" -#include "platform.h" -#include "osd.h" -#include "unmanaged.h" - -#include - -namespace KWin -{ - -KillWindow::KillWindow() -{ -} - -KillWindow::~KillWindow() -{ -} - -void KillWindow::start() -{ - OSD::show(i18n("Select window to force close with left click or enter.\nEscape or right click to cancel."), - QStringLiteral("window-close")); - kwinApp()->platform()->startInteractiveWindowSelection( - [] (KWin::Toplevel *t) { - OSD::hide(); - if (!t) { - return; - } - if (AbstractClient *c = qobject_cast(t)) { - c->killWindow(); - } else if (Unmanaged *u = qobject_cast(t)) { - xcb_kill_client(connection(), u->window()); - } - }, QByteArrayLiteral("pirate") - ); -} - -} // namespace diff --git a/useractions.cpp b/useractions.cpp --- a/useractions.cpp +++ b/useractions.cpp @@ -43,6 +43,8 @@ #include "shell_client.h" #include "virtualdesktops.h" #include "scripting/scripting.h" +#include "osd.h" +#include "unmanaged.h" #ifdef KWIN_BUILD_ACTIVITIES #include "activities.h" @@ -66,7 +68,6 @@ #include #include -#include "killwindow.h" #ifdef KWIN_BUILD_TABBOX #include "tabbox.h" #endif @@ -1665,10 +1666,21 @@ */ void Workspace::slotKillWindow() { - if (m_windowKiller.isNull()) { - m_windowKiller.reset(new KillWindow()); - } - m_windowKiller->start(); + OSD::show(i18n("Select window to force close with left click or enter.\nEscape or right click to cancel."), + QStringLiteral("window-close")); + kwinApp()->platform()->startInteractiveWindowSelection( + [] (KWin::Toplevel *t) { + OSD::hide(); + if (!t) { + return; + } + if (AbstractClient *c = qobject_cast(t)) { + c->killWindow(); + } else if (Unmanaged *u = qobject_cast(t)) { + xcb_kill_client(connection(), u->window()); + } + }, QByteArrayLiteral("pirate") + ); } /*! diff --git a/workspace.h b/workspace.h --- a/workspace.h +++ b/workspace.h @@ -54,7 +54,6 @@ class AbstractClient; class Client; -class KillWindow; class ShortcutDialog; class UserActionsMenu; class Compositor; @@ -621,8 +620,6 @@ QScopedPointer m_nullFocus; friend class StackingUpdatesBlocker; - QScopedPointer m_windowKiller; - QList m_eventFilters; QList m_genericEventFilters; QScopedPointer m_movingClientFilter; diff --git a/workspace.cpp b/workspace.cpp --- a/workspace.cpp +++ b/workspace.cpp @@ -39,7 +39,6 @@ #include "input.h" #include "logind.h" #include "moving_client_x11_filter.h" -#include "killwindow.h" #include "netinfo.h" #include "outline.h" #include "placement.h"