Changeset View
Changeset View
Standalone View
Standalone View
touch_input.cpp
Show All 12 Lines | |||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #include "touch_input.h" | 20 | #include "touch_input.h" | ||
21 | #include "abstract_client.h" | ||||
21 | #include "input.h" | 22 | #include "input.h" | ||
22 | #include "toplevel.h" | 23 | #include "toplevel.h" | ||
23 | #include "wayland_server.h" | 24 | #include "wayland_server.h" | ||
24 | #include "workspace.h" | 25 | #include "workspace.h" | ||
26 | #include "decorations/decoratedclient.h" | ||||
27 | // KDecoration | ||||
28 | #include <KDecoration2/Decoration> | ||||
25 | // KWayland | 29 | // KWayland | ||
26 | #include <KWayland/Server/seat_interface.h> | 30 | #include <KWayland/Server/seat_interface.h> | ||
27 | // screenlocker | 31 | // screenlocker | ||
28 | #include <KScreenLocker/KsldApp> | 32 | #include <KScreenLocker/KsldApp> | ||
33 | // Qt | ||||
34 | #include <QHoverEvent> | ||||
29 | 35 | | |||
30 | namespace KWin | 36 | namespace KWin | ||
31 | { | 37 | { | ||
32 | 38 | | |||
33 | TouchInputRedirection::TouchInputRedirection(InputRedirection *parent) | 39 | TouchInputRedirection::TouchInputRedirection(InputRedirection *parent) | ||
34 | : QObject(parent) | 40 | : InputDeviceHandler(parent) | ||
35 | , m_input(parent) | | |||
36 | { | 41 | { | ||
37 | } | 42 | } | ||
38 | 43 | | |||
39 | TouchInputRedirection::~TouchInputRedirection() = default; | 44 | TouchInputRedirection::~TouchInputRedirection() = default; | ||
40 | 45 | | |||
41 | void TouchInputRedirection::init() | 46 | void TouchInputRedirection::init() | ||
42 | { | 47 | { | ||
43 | Q_ASSERT(!m_inited); | 48 | Q_ASSERT(!m_inited); | ||
Show All 15 Lines | |||||
59 | void TouchInputRedirection::update(const QPointF &pos) | 64 | void TouchInputRedirection::update(const QPointF &pos) | ||
60 | { | 65 | { | ||
61 | if (!m_inited) { | 66 | if (!m_inited) { | ||
62 | return; | 67 | return; | ||
63 | } | 68 | } | ||
64 | // TODO: handle pointer grab aka popups | 69 | // TODO: handle pointer grab aka popups | ||
65 | Toplevel *t = m_input->findToplevel(pos.toPoint()); | 70 | Toplevel *t = m_input->findToplevel(pos.toPoint()); | ||
66 | auto oldWindow = m_window; | 71 | auto oldWindow = m_window; | ||
72 | updateDecoration(t, pos); | ||||
73 | if (m_decoration) { | ||||
74 | t = nullptr; | ||||
75 | } else { | ||||
76 | m_decorationId = -1; | ||||
77 | } | ||||
67 | if (!oldWindow.isNull() && t == oldWindow.data()) { | 78 | if (!oldWindow.isNull() && t == oldWindow.data()) { | ||
68 | return; | 79 | return; | ||
69 | } | 80 | } | ||
70 | auto seat = waylandServer()->seat(); | 81 | auto seat = waylandServer()->seat(); | ||
71 | // disconnect old surface | 82 | // disconnect old surface | ||
72 | if (oldWindow) { | 83 | if (oldWindow) { | ||
73 | disconnect(m_windowGeometryConnection); | 84 | disconnect(m_windowGeometryConnection); | ||
74 | m_windowGeometryConnection = QMetaObject::Connection(); | 85 | m_windowGeometryConnection = QMetaObject::Connection(); | ||
▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines |