Changeset View
Changeset View
Standalone View
Standalone View
touch_input.h
1 | /******************************************************************** | 1 | /******************************************************************** | ||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | 2 | KWin - the KDE window manager | ||
3 | This file is part of the KDE project. | 3 | This file is part of the KDE project. | ||
4 | 4 | | |||
5 | Copyright (C) 2013, 2016 Martin Gräßlin <mgraesslin@kde.org> | 5 | Copyright (C) 2013, 2016 Martin Gräßlin <mgraesslin@kde.org> | ||
6 | Copyright (C) 2018 Roman Gilg <subdiff@gmail.com> | ||||
6 | 7 | | |||
7 | This program is free software; you can redistribute it and/or modify | 8 | This program is free software; you can redistribute it and/or modify | ||
8 | it under the terms of the GNU General Public License as published by | 9 | it under the terms of the GNU General Public License as published by | ||
9 | the Free Software Foundation; either version 2 of the License, or | 10 | the Free Software Foundation; either version 2 of the License, or | ||
10 | (at your option) any later version. | 11 | (at your option) any later version. | ||
11 | 12 | | |||
12 | This program is distributed in the hope that it will be useful, | 13 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
Show All 30 Lines | |||||
44 | 45 | | |||
45 | class TouchInputRedirection : public InputDeviceHandler | 46 | class TouchInputRedirection : public InputDeviceHandler | ||
46 | { | 47 | { | ||
47 | Q_OBJECT | 48 | Q_OBJECT | ||
48 | public: | 49 | public: | ||
49 | explicit TouchInputRedirection(InputRedirection *parent); | 50 | explicit TouchInputRedirection(InputRedirection *parent); | ||
50 | virtual ~TouchInputRedirection(); | 51 | virtual ~TouchInputRedirection(); | ||
51 | 52 | | |||
52 | void update(const QPointF &pos = QPointF()); | 53 | bool focusUpdatesBlocked() override; | ||
53 | void init(); | 54 | void init(); | ||
54 | 55 | | |||
55 | void processDown(qint32 id, const QPointF &pos, quint32 time, LibInput::Device *device = nullptr); | 56 | void processDown(qint32 id, const QPointF &pos, quint32 time, LibInput::Device *device = nullptr); | ||
56 | void processUp(qint32 id, quint32 time, LibInput::Device *device = nullptr); | 57 | void processUp(qint32 id, quint32 time, LibInput::Device *device = nullptr); | ||
57 | void processMotion(qint32 id, const QPointF &pos, quint32 time, LibInput::Device *device = nullptr); | 58 | void processMotion(qint32 id, const QPointF &pos, quint32 time, LibInput::Device *device = nullptr); | ||
58 | void cancel(); | 59 | void cancel(); | ||
59 | void frame(); | 60 | void frame(); | ||
60 | 61 | | |||
Show All 9 Lines | |||||
70 | } | 71 | } | ||
71 | void setInternalPressId(qint32 id) { | 72 | void setInternalPressId(qint32 id) { | ||
72 | m_internalId = id; | 73 | m_internalId = id; | ||
73 | } | 74 | } | ||
74 | qint32 internalPressId() const { | 75 | qint32 internalPressId() const { | ||
75 | return m_internalId; | 76 | return m_internalId; | ||
76 | } | 77 | } | ||
77 | 78 | | |||
79 | QPointF position() const override { | ||||
80 | return m_lastPosition; | ||||
81 | } | ||||
82 | | ||||
78 | private: | 83 | private: | ||
84 | void cleanupInternalWindow(QWindow *old, QWindow *now) override; | ||||
85 | void cleanupDecoration(Decoration::DecoratedClientImpl *old, Decoration::DecoratedClientImpl *now) override; | ||||
86 | | ||||
87 | void focusUpdate(Toplevel *focusOld, Toplevel *focusNow) override; | ||||
88 | | ||||
79 | bool m_inited = false; | 89 | bool m_inited = false; | ||
80 | qint32 m_decorationId = -1; | 90 | qint32 m_decorationId = -1; | ||
81 | qint32 m_internalId = -1; | 91 | qint32 m_internalId = -1; | ||
82 | /** | 92 | /** | ||
83 | * external/kwayland | 93 | * external/kwayland | ||
84 | **/ | 94 | **/ | ||
85 | QHash<qint32, qint32> m_idMapper; | 95 | QHash<qint32, qint32> m_idMapper; | ||
86 | QMetaObject::Connection m_windowGeometryConnection; | 96 | QMetaObject::Connection m_focusGeometryConnection; | ||
87 | bool m_windowUpdatedInCycle = false; | 97 | bool m_windowUpdatedInCycle = false; | ||
98 | QPointF m_lastPosition; | ||||
99 | | ||||
100 | int m_touches = 0; | ||||
88 | }; | 101 | }; | ||
89 | 102 | | |||
90 | } | 103 | } | ||
91 | 104 | | |||
92 | #endif | 105 | #endif |