Changeset View
Changeset View
Standalone View
Standalone View
touch_input.cpp
Show All 24 Lines | |||||
25 | #include "input_event_spy.h" | 25 | #include "input_event_spy.h" | ||
26 | #include "toplevel.h" | 26 | #include "toplevel.h" | ||
27 | #include "wayland_server.h" | 27 | #include "wayland_server.h" | ||
28 | #include "workspace.h" | 28 | #include "workspace.h" | ||
29 | #include "decorations/decoratedclient.h" | 29 | #include "decorations/decoratedclient.h" | ||
30 | // KDecoration | 30 | // KDecoration | ||
31 | #include <KDecoration2/Decoration> | 31 | #include <KDecoration2/Decoration> | ||
32 | // KWayland | 32 | // KWayland | ||
33 | #include <KWayland/Server/seat_interface.h> | 33 | #include <KWaylandServer/seat_interface.h> | ||
34 | // screenlocker | 34 | // screenlocker | ||
35 | #include <KScreenLocker/KsldApp> | 35 | #include <KScreenLocker/KsldApp> | ||
36 | // Qt | 36 | // Qt | ||
37 | #include <QHoverEvent> | 37 | #include <QHoverEvent> | ||
38 | #include <QWindow> | 38 | #include <QWindow> | ||
39 | 39 | | |||
40 | namespace KWin | 40 | namespace KWin | ||
41 | { | 41 | { | ||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | 96 | { | |||
111 | if (!focusNow || !focusNow->surface() || decoration()) { | 111 | if (!focusNow || !focusNow->surface() || decoration()) { | ||
112 | // no new surface or internal window or on decoration -> cleanup | 112 | // no new surface or internal window or on decoration -> cleanup | ||
113 | seat->setFocusedTouchSurface(nullptr); | 113 | seat->setFocusedTouchSurface(nullptr); | ||
114 | return; | 114 | return; | ||
115 | } | 115 | } | ||
116 | 116 | | |||
117 | // TODO: invalidate pointer focus? | 117 | // TODO: invalidate pointer focus? | ||
118 | 118 | | |||
119 | // FIXME: add input transformation API to KWayland::Server::SeatInterface for touch input | 119 | // FIXME: add input transformation API to KWaylandServer::SeatInterface for touch input | ||
120 | seat->setFocusedTouchSurface(focusNow->surface(), -1 * focusNow->inputTransformation().map(focusNow->pos()) + focusNow->pos()); | 120 | seat->setFocusedTouchSurface(focusNow->surface(), -1 * focusNow->inputTransformation().map(focusNow->pos()) + focusNow->pos()); | ||
121 | m_focusGeometryConnection = connect(focusNow, &Toplevel::frameGeometryChanged, this, | 121 | m_focusGeometryConnection = connect(focusNow, &Toplevel::frameGeometryChanged, this, | ||
122 | [this] { | 122 | [this] { | ||
123 | if (focus().isNull()) { | 123 | if (focus().isNull()) { | ||
124 | return; | 124 | return; | ||
125 | } | 125 | } | ||
126 | auto seat = waylandServer()->seat(); | 126 | auto seat = waylandServer()->seat(); | ||
127 | if (focus().data()->surface() != seat->focusedTouchSurface()) { | 127 | if (focus().data()->surface() != seat->focusedTouchSurface()) { | ||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |