File indexing completed on 2024-11-10 04:57:49

0001 /*
0002     KWin - the KDE window manager
0003     This file is part of the KDE project.
0004 
0005     SPDX-FileCopyrightText: 1999, 2000 Matthias Ettrich <ettrich@kde.org>
0006     SPDX-FileCopyrightText: 2003 Lubos Lunak <l.lunak@kde.org>
0007     SPDX-FileCopyrightText: 2012 Martin Gräßlin <mgraesslin@kde.org>
0008 
0009     SPDX-License-Identifier: GPL-2.0-or-later
0010 */
0011 #include "killwindow.h"
0012 #include "main.h"
0013 #include "osd.h"
0014 #include "window.h"
0015 
0016 #include <KLocalizedString>
0017 
0018 namespace KWin
0019 {
0020 
0021 KillWindow::KillWindow()
0022 {
0023 }
0024 
0025 KillWindow::~KillWindow()
0026 {
0027 }
0028 
0029 void KillWindow::start()
0030 {
0031     OSD::show(i18n("Select window to force close with left click or enter.\nEscape or right click to cancel."),
0032               QStringLiteral("window-close"));
0033     kwinApp()->startInteractiveWindowSelection(
0034         [](KWin::Window *window) {
0035             OSD::hide();
0036             if (window) {
0037                 window->killWindow();
0038             }
0039         },
0040         QByteArrayLiteral("pirate"));
0041 }
0042 
0043 } // namespace