kwin/src/killwindow.cpp

44 lines
965 B
C++
Raw Normal View History

2020-08-02 22:22:19 +00:00
/*
KWin - the KDE window manager
This file is part of the KDE project.
2020-08-02 22:22:19 +00:00
SPDX-FileCopyrightText: 1999, 2000 Matthias Ettrich <ettrich@kde.org>
SPDX-FileCopyrightText: 2003 Lubos Lunak <l.lunak@kde.org>
SPDX-FileCopyrightText: 2012 Martin Gräßlin <mgraesslin@kde.org>
2020-08-02 22:22:19 +00:00
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "killwindow.h"
#include "main.h"
#include "osd.h"
2022-04-22 17:39:12 +00:00
#include "window.h"
#include <KLocalizedString>
namespace KWin
{
KillWindow::KillWindow()
2011-01-30 14:34:42 +00:00
{
}
KillWindow::~KillWindow()
2011-01-30 14:34:42 +00:00
{
}
2011-01-30 14:34:42 +00:00
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()->startInteractiveWindowSelection(
[](KWin::Window *window) {
OSD::hide();
if (window) {
window->killWindow();
}
},
QByteArrayLiteral("pirate"));
}
} // namespace