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

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 <QList>
0012 #include <QObject>
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 cancelPopups();
0030 
0031     QList<Window *> m_popupWindows;
0032 };
0033 }