File indexing completed on 2024-04-28 05:30:22

0001 /*
0002  * SPDX-FileCopyrightText: 2023 Kai Uwe Broulik <kde@broulik.de>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #pragma once
0008 
0009 #include <QProcess>
0010 
0011 namespace KWin
0012 {
0013 
0014 class Window;
0015 
0016 class KillPrompt
0017 {
0018 public:
0019     /**
0020      * @brief Creates a kill helper process.
0021      * @param window The window to kill, must be an X11Window or XdgToplevelWindow.
0022      */
0023     explicit KillPrompt(Window *window);
0024 
0025     /**
0026      * @brief Whether the kill helper process is currently running.
0027      */
0028     bool isRunning() const;
0029 
0030     /**
0031      * @brief Starts the kill helper process.
0032      * @param timestamp The X activation timestamp.
0033      */
0034     void start(quint32 timestamp = 0);
0035     /**
0036      * @brief Terminate the kill helper process.
0037      */
0038     void quit();
0039 
0040 private:
0041     Window *m_window = nullptr;
0042     QProcess m_process;
0043 };
0044 
0045 } // namespace KWin