Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KWin
Commits
311a370d
Commit
311a370d
authored
Feb 15, 2021
by
Vlad Zahorodnii
Browse files
wayland: Port kwin to SeatInterface::touchDown() changes
parent
22d386cd
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/input.cpp
View file @
311a370d
...
...
@@ -334,7 +334,7 @@ public:
auto
seat
=
waylandServer
()
->
seat
();
seat
->
setTimestamp
(
time
);
if
(
touchSurfaceAllowed
())
{
input
()
->
touch
()
->
insertId
(
id
,
seat
->
touchDown
(
pos
)
)
;
seat
->
touchDown
(
id
,
pos
);
}
return
true
;
}
...
...
@@ -345,10 +345,7 @@ public:
auto
seat
=
waylandServer
()
->
seat
();
seat
->
setTimestamp
(
time
);
if
(
touchSurfaceAllowed
())
{
const
qint32
kwaylandId
=
input
()
->
touch
()
->
mappedId
(
id
);
if
(
kwaylandId
!=
-
1
)
{
seat
->
touchMove
(
kwaylandId
,
pos
);
}
seat
->
touchMove
(
id
,
pos
);
}
return
true
;
}
...
...
@@ -359,11 +356,7 @@ public:
auto
seat
=
waylandServer
()
->
seat
();
seat
->
setTimestamp
(
time
);
if
(
touchSurfaceAllowed
())
{
const
qint32
kwaylandId
=
input
()
->
touch
()
->
mappedId
(
id
);
if
(
kwaylandId
!=
-
1
)
{
seat
->
touchUp
(
kwaylandId
);
input
()
->
touch
()
->
removeId
(
id
);
}
seat
->
touchUp
(
id
);
}
return
true
;
}
...
...
@@ -1444,7 +1437,7 @@ public:
}
auto
seat
=
waylandServer
()
->
seat
();
seat
->
setTimestamp
(
time
);
input
()
->
touch
()
->
insertId
(
id
,
seat
->
touchDown
(
pos
)
)
;
seat
->
touchDown
(
id
,
pos
);
return
true
;
}
bool
touchMotion
(
qint32
id
,
const
QPointF
&
pos
,
quint32
time
)
override
{
...
...
@@ -1453,10 +1446,7 @@ public:
}
auto
seat
=
waylandServer
()
->
seat
();
seat
->
setTimestamp
(
time
);
const
qint32
kwaylandId
=
input
()
->
touch
()
->
mappedId
(
id
);
if
(
kwaylandId
!=
-
1
)
{
seat
->
touchMove
(
kwaylandId
,
pos
);
}
seat
->
touchMove
(
id
,
pos
);
return
true
;
}
bool
touchUp
(
qint32
id
,
quint32
time
)
override
{
...
...
@@ -1465,11 +1455,7 @@ public:
}
auto
seat
=
waylandServer
()
->
seat
();
seat
->
setTimestamp
(
time
);
const
qint32
kwaylandId
=
input
()
->
touch
()
->
mappedId
(
id
);
if
(
kwaylandId
!=
-
1
)
{
seat
->
touchUp
(
kwaylandId
);
input
()
->
touch
()
->
removeId
(
id
);
}
seat
->
touchUp
(
id
);
return
true
;
}
bool
pinchGestureBegin
(
int
fingerCount
,
quint32
time
)
override
{
...
...
@@ -1946,7 +1932,7 @@ public:
return
true
;
}
seat
->
setTimestamp
(
time
);
input
()
->
touch
()
->
insertId
(
id
,
seat
->
touchDown
(
pos
)
)
;
seat
->
touchDown
(
id
,
pos
);
return
true
;
}
bool
touchMotion
(
qint32
id
,
const
QPointF
&
pos
,
quint32
time
)
override
{
...
...
@@ -1967,12 +1953,7 @@ public:
return
true
;
}
seat
->
setTimestamp
(
time
);
const
qint32
kwaylandId
=
input
()
->
touch
()
->
mappedId
(
id
);
if
(
kwaylandId
==
-
1
)
{
return
true
;
}
seat
->
touchMove
(
kwaylandId
,
pos
);
seat
->
touchMove
(
id
,
pos
);
if
(
Toplevel
*
t
=
input
()
->
findToplevel
(
pos
.
toPoint
()))
{
// TODO: consider decorations
...
...
@@ -1994,11 +1975,7 @@ public:
return
false
;
}
seat
->
setTimestamp
(
time
);
const
qint32
kwaylandId
=
input
()
->
touch
()
->
mappedId
(
id
);
if
(
kwaylandId
!=
-
1
)
{
seat
->
touchUp
(
kwaylandId
);
input
()
->
touch
()
->
removeId
(
id
);
}
seat
->
touchUp
(
id
);
if
(
m_touchId
==
id
)
{
m_touchId
=
-
1
;
}
...
...
src/libinput/events.cpp
View file @
311a370d
...
...
@@ -261,11 +261,9 @@ QPointF TouchEvent::absolutePos(const QSize &size) const
qint32
TouchEvent
::
id
()
const
{
Q_ASSERT
(
type
()
!=
LIBINPUT_EVENT_TOUCH_CANCEL
&&
type
()
!=
LIBINPUT_EVENT_TOUCH_FRAME
);
Q_ASSERT
(
type
()
!=
LIBINPUT_EVENT_TOUCH_FRAME
);
const
qint32
slot
=
libinput_event_touch_get_seat_slot
(
m_touchEvent
);
return
slot
==
-
1
?
0
:
slot
;
return
libinput_event_touch_get_seat_slot
(
m_touchEvent
);
}
GestureEvent
::
GestureEvent
(
libinput_event
*
event
,
libinput_event_type
type
)
...
...
src/touch_input.cpp
View file @
311a370d
...
...
@@ -136,25 +136,6 @@ void TouchInputRedirection::cleanupDecoration(Decoration::DecoratedClientImpl *o
// nothing to do
}
void
TouchInputRedirection
::
insertId
(
qint32
internalId
,
qint32
kwaylandId
)
{
m_idMapper
.
insert
(
internalId
,
kwaylandId
);
}
qint32
TouchInputRedirection
::
mappedId
(
qint32
internalId
)
{
auto
it
=
m_idMapper
.
constFind
(
internalId
);
if
(
it
!=
m_idMapper
.
constEnd
())
{
return
it
.
value
();
}
return
-
1
;
}
void
TouchInputRedirection
::
removeId
(
qint32
internalId
)
{
m_idMapper
.
remove
(
internalId
);
}
void
TouchInputRedirection
::
processDown
(
qint32
id
,
const
QPointF
&
pos
,
quint32
time
,
LibInput
::
Device
*
device
)
{
Q_UNUSED
(
device
)
...
...
@@ -213,7 +194,6 @@ void TouchInputRedirection::cancel()
return
;
}
waylandServer
()
->
seat
()
->
cancelTouchSequence
();
m_idMapper
.
clear
();
}
void
TouchInputRedirection
::
frame
()
...
...
src/touch_input.h
View file @
311a370d
...
...
@@ -50,10 +50,6 @@ public:
void
cancel
();
void
frame
();
void
insertId
(
qint32
internalId
,
qint32
kwaylandId
);
void
removeId
(
qint32
internalId
);
qint32
mappedId
(
qint32
internalId
);
void
setDecorationPressId
(
qint32
id
)
{
m_decorationId
=
id
;
}
...
...
@@ -84,10 +80,6 @@ private:
bool
m_inited
=
false
;
qint32
m_decorationId
=
-
1
;
qint32
m_internalId
=
-
1
;
/**
* external/kwayland
*/
QHash
<
qint32
,
qint32
>
m_idMapper
;
QMetaObject
::
Connection
m_focusGeometryConnection
;
bool
m_windowUpdatedInCycle
=
false
;
QPointF
m_lastPosition
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment