File indexing completed on 2024-12-01 11:10:05
0001 /* 0002 SPDX-FileCopyrightText: 2017 Martin Graesslin <mgraesslin@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0005 0006 */ 0007 #pragma once 0008 0009 #include "input.h" 0010 0011 #include <QObject> 0012 #include <QVector> 0013 0014 namespace KWin 0015 { 0016 class Window; 0017 0018 class PopupInputFilter : public QObject, public InputEventFilter 0019 { 0020 Q_OBJECT 0021 public: 0022 explicit PopupInputFilter(); 0023 bool pointerEvent(MouseEvent *event, quint32 nativeButton) override; 0024 bool keyEvent(KeyEvent *event) override; 0025 bool touchDown(qint32 id, const QPointF &pos, std::chrono::microseconds time) override; 0026 0027 private: 0028 void handleWindowAdded(Window *client); 0029 void handleWindowRemoved(Window *client); 0030 void disconnectClient(Window *client); 0031 void cancelPopups(); 0032 0033 QVector<Window *> m_popupWindows; 0034 }; 0035 }