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
7626dbb1
Commit
7626dbb1
authored
Feb 11, 2022
by
Aleix Pol Gonzalez
🐧
Committed by
Aleix Pol Gonzalez
Feb 14, 2022
Browse files
inputmethod: Also open the inputm method panel with a pen
BUG: 449888
(cherry picked from commit
ad0a3588
)
parent
bf85f6ea
Pipeline
#137185
passed with stage
in 14 minutes and 46 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/input.cpp
View file @
7626dbb1
...
...
@@ -2301,6 +2301,16 @@ void InputRedirection::setupWorkspace()
}
}
QObject
*
InputRedirection
::
lastInputHandler
()
const
{
return
m_lastInputDevice
;
}
void
InputRedirection
::
setLastInputHandler
(
QObject
*
device
)
{
m_lastInputDevice
=
device
;
}
class
UserActivitySpy
:
public
InputEventSpy
{
public:
...
...
@@ -3005,11 +3015,6 @@ Decoration::DecoratedClientImpl *InputDeviceHandler::decoration() const
return
m_focus
.
decoration
;
}
uint32_t
InputDeviceHandler
::
lastEventTime
()
const
{
return
m_lastEventTime
;
}
}
// namespace
#include
"input.moc"
src/input.h
View file @
7626dbb1
...
...
@@ -217,6 +217,12 @@ public:
return
m_touch
;
}
/**
* Specifies which was the device that triggered the last input event
*/
void
setLastInputHandler
(
QObject
*
device
);
QObject
*
lastInputHandler
()
const
;
QList
<
InputDevice
*>
devices
()
const
;
bool
hasAlphaNumericKeyboard
();
...
...
@@ -297,6 +303,7 @@ private:
PointerInputRedirection
*
m_pointer
;
TabletInputRedirection
*
m_tablet
;
TouchInputRedirection
*
m_touch
;
QObject
*
m_lastInputDevice
=
nullptr
;
GlobalShortcutsManager
*
m_shortcuts
;
...
...
@@ -444,8 +451,6 @@ public:
void
setFocus
(
Toplevel
*
toplevel
);
void
setDecoration
(
Decoration
::
DecoratedClientImpl
*
decoration
);
uint32_t
lastEventTime
()
const
;
Q_SIGNALS:
void
decorationChanged
();
...
...
@@ -475,8 +480,6 @@ protected:
m_inited
=
set
;
}
uint32_t
m_lastEventTime
=
0
;
private:
bool
setHover
(
Toplevel
*
toplevel
);
void
updateFocus
();
...
...
src/inputmethod.cpp
View file @
7626dbb1
...
...
@@ -19,7 +19,7 @@
#include
"screenlockerwatcher.h"
#include
"deleted.h"
#include
"touch_input.h"
#include
"
pointer
_input.h"
#include
"
tablet
_input.h"
#include
<KWaylandServer/display.h>
#include
<KWaylandServer/keyboard_interface.h>
...
...
@@ -134,9 +134,8 @@ void InputMethod::hide()
bool
InputMethod
::
shouldShowOnActive
()
const
{
return
input
()
->
touch
()
&&
input
()
->
touch
()
->
lastEventTime
()
>
input
()
->
keyboard
()
->
lastEventTime
()
&&
input
()
->
touch
()
->
lastEventTime
()
>
input
()
->
pointer
()
->
lastEventTime
();
return
input
()
->
touch
()
==
input
()
->
lastInputHandler
()
||
input
()
->
tablet
()
==
input
()
->
lastInputHandler
();
}
void
InputMethod
::
setActive
(
bool
active
)
...
...
src/keyboard_input.cpp
View file @
7626dbb1
...
...
@@ -244,7 +244,7 @@ void KeyboardInputRedirection::processKey(uint32_t key, InputRedirection::Keyboa
if
(
!
m_inited
)
{
return
;
}
m_lastEventTime
=
time
;
input
()
->
setLastInputHandler
(
this
)
;
m_input
->
processFilters
(
std
::
bind
(
&
InputEventFilter
::
keyEvent
,
std
::
placeholders
::
_1
,
&
event
));
m_xkb
->
forwardModifiers
();
...
...
src/keyboard_input.h
View file @
7626dbb1
...
...
@@ -73,10 +73,6 @@ public:
return
m_xkb
->
modifiersRelevantForGlobalShortcuts
();
}
uint32_t
lastEventTime
()
const
{
return
m_lastEventTime
;
}
Q_SIGNALS:
void
ledsChanged
(
KWin
::
LEDs
);
...
...
@@ -87,7 +83,6 @@ private:
QMetaObject
::
Connection
m_activeClientSurfaceChangedConnection
;
ModifiersChangedSpy
*
m_modifiersChangedSpy
=
nullptr
;
KeyboardLayout
*
m_keyboardLayout
=
nullptr
;
uint32_t
m_lastEventTime
=
0
;
};
}
...
...
src/pointer_input.cpp
View file @
7626dbb1
...
...
@@ -257,7 +257,7 @@ void PointerInputRedirection::processMotion(const QSizeF &delta, const QSizeF &d
void
PointerInputRedirection
::
processMotionInternal
(
const
QPointF
&
pos
,
const
QSizeF
&
delta
,
const
QSizeF
&
deltaNonAccelerated
,
uint32_t
time
,
quint64
timeUsec
,
InputDevice
*
device
)
{
m_lastEventTime
=
time
;
input
()
->
setLastInputHandler
(
this
)
;
if
(
!
inited
())
{
return
;
}
...
...
@@ -280,7 +280,7 @@ void PointerInputRedirection::processMotionInternal(const QPointF &pos, const QS
void
PointerInputRedirection
::
processButton
(
uint32_t
button
,
InputRedirection
::
PointerButtonState
state
,
uint32_t
time
,
InputDevice
*
device
)
{
m_lastEventTime
=
time
;
input
()
->
setLastInputHandler
(
this
)
;
QEvent
::
Type
type
;
switch
(
state
)
{
case
InputRedirection
::
PointerButtonReleased
:
...
...
@@ -318,7 +318,7 @@ void PointerInputRedirection::processButton(uint32_t button, InputRedirection::P
void
PointerInputRedirection
::
processAxis
(
InputRedirection
::
PointerAxis
axis
,
qreal
delta
,
qint32
discreteDelta
,
InputRedirection
::
PointerAxisSource
source
,
uint32_t
time
,
InputDevice
*
device
)
{
m_lastEventTime
=
time
;
input
()
->
setLastInputHandler
(
this
)
;
update
();
Q_EMIT
input
()
->
pointerAxisChanged
(
axis
,
delta
);
...
...
@@ -338,7 +338,7 @@ void PointerInputRedirection::processAxis(InputRedirection::PointerAxis axis, qr
void
PointerInputRedirection
::
processSwipeGestureBegin
(
int
fingerCount
,
quint32
time
,
KWin
::
InputDevice
*
device
)
{
m_lastEventTime
=
time
;
input
()
->
setLastInputHandler
(
this
)
;
Q_UNUSED
(
device
)
if
(
!
inited
())
{
return
;
...
...
@@ -350,7 +350,7 @@ void PointerInputRedirection::processSwipeGestureBegin(int fingerCount, quint32
void
PointerInputRedirection
::
processSwipeGestureUpdate
(
const
QSizeF
&
delta
,
quint32
time
,
KWin
::
InputDevice
*
device
)
{
m_lastEventTime
=
time
;
input
()
->
setLastInputHandler
(
this
)
;
Q_UNUSED
(
device
)
if
(
!
inited
())
{
return
;
...
...
@@ -363,7 +363,7 @@ void PointerInputRedirection::processSwipeGestureUpdate(const QSizeF &delta, qui
void
PointerInputRedirection
::
processSwipeGestureEnd
(
quint32
time
,
KWin
::
InputDevice
*
device
)
{
m_lastEventTime
=
time
;
input
()
->
setLastInputHandler
(
this
)
;
Q_UNUSED
(
device
)
if
(
!
inited
())
{
return
;
...
...
@@ -376,7 +376,7 @@ void PointerInputRedirection::processSwipeGestureEnd(quint32 time, KWin::InputDe
void
PointerInputRedirection
::
processSwipeGestureCancelled
(
quint32
time
,
KWin
::
InputDevice
*
device
)
{
m_lastEventTime
=
time
;
input
()
->
setLastInputHandler
(
this
)
;
Q_UNUSED
(
device
)
if
(
!
inited
())
{
return
;
...
...
@@ -389,7 +389,7 @@ void PointerInputRedirection::processSwipeGestureCancelled(quint32 time, KWin::I
void
PointerInputRedirection
::
processPinchGestureBegin
(
int
fingerCount
,
quint32
time
,
KWin
::
InputDevice
*
device
)
{
m_lastEventTime
=
time
;
input
()
->
setLastInputHandler
(
this
)
;
Q_UNUSED
(
device
)
if
(
!
inited
())
{
return
;
...
...
@@ -402,7 +402,7 @@ void PointerInputRedirection::processPinchGestureBegin(int fingerCount, quint32
void
PointerInputRedirection
::
processPinchGestureUpdate
(
qreal
scale
,
qreal
angleDelta
,
const
QSizeF
&
delta
,
quint32
time
,
KWin
::
InputDevice
*
device
)
{
m_lastEventTime
=
time
;
input
()
->
setLastInputHandler
(
this
)
;
Q_UNUSED
(
device
)
if
(
!
inited
())
{
return
;
...
...
@@ -415,7 +415,7 @@ void PointerInputRedirection::processPinchGestureUpdate(qreal scale, qreal angle
void
PointerInputRedirection
::
processPinchGestureEnd
(
quint32
time
,
KWin
::
InputDevice
*
device
)
{
m_lastEventTime
=
time
;
input
()
->
setLastInputHandler
(
this
)
;
Q_UNUSED
(
device
)
if
(
!
inited
())
{
return
;
...
...
@@ -428,7 +428,7 @@ void PointerInputRedirection::processPinchGestureEnd(quint32 time, KWin::InputDe
void
PointerInputRedirection
::
processPinchGestureCancelled
(
quint32
time
,
KWin
::
InputDevice
*
device
)
{
m_lastEventTime
=
time
;
input
()
->
setLastInputHandler
(
this
)
;
Q_UNUSED
(
device
)
if
(
!
inited
())
{
return
;
...
...
src/tablet_input.cpp
View file @
7626dbb1
...
...
@@ -53,7 +53,7 @@ void TabletInputRedirection::tabletToolEvent(KWin::InputRedirection::TabletEvent
if
(
!
inited
())
{
return
;
}
m_lastEventTime
=
time
;
input
()
->
setLastInputHandler
(
this
)
;
m_lastPosition
=
pos
;
QEvent
::
Type
t
;
...
...
@@ -95,6 +95,7 @@ void KWin::TabletInputRedirection::tabletToolButtonEvent(uint button, bool isPre
std
::
placeholders
::
_1
,
button
,
isPressed
,
tabletToolId
));
input
()
->
processFilters
(
std
::
bind
(
&
InputEventFilter
::
tabletToolButtonEvent
,
std
::
placeholders
::
_1
,
button
,
isPressed
,
tabletToolId
));
input
()
->
setLastInputHandler
(
this
);
}
void
KWin
::
TabletInputRedirection
::
tabletPadButtonEvent
(
uint
button
,
bool
isPressed
,
...
...
@@ -104,6 +105,7 @@ void KWin::TabletInputRedirection::tabletPadButtonEvent(uint button, bool isPres
std
::
placeholders
::
_1
,
button
,
isPressed
,
tabletPadId
));
input
()
->
processFilters
(
std
::
bind
(
&
InputEventFilter
::
tabletPadButtonEvent
,
std
::
placeholders
::
_1
,
button
,
isPressed
,
tabletPadId
));
input
()
->
setLastInputHandler
(
this
);
}
void
KWin
::
TabletInputRedirection
::
tabletPadStripEvent
(
int
number
,
int
position
,
bool
isFinger
,
...
...
@@ -113,6 +115,7 @@ void KWin::TabletInputRedirection::tabletPadStripEvent(int number, int position,
std
::
placeholders
::
_1
,
number
,
position
,
isFinger
,
tabletPadId
));
input
()
->
processFilters
(
std
::
bind
(
&
InputEventFilter
::
tabletPadStripEvent
,
std
::
placeholders
::
_1
,
number
,
position
,
isFinger
,
tabletPadId
));
input
()
->
setLastInputHandler
(
this
);
}
void
KWin
::
TabletInputRedirection
::
tabletPadRingEvent
(
int
number
,
int
position
,
bool
isFinger
,
...
...
@@ -122,6 +125,7 @@ void KWin::TabletInputRedirection::tabletPadRingEvent(int number, int position,
std
::
placeholders
::
_1
,
number
,
position
,
isFinger
,
tabletPadId
));
input
()
->
processFilters
(
std
::
bind
(
&
InputEventFilter
::
tabletPadRingEvent
,
std
::
placeholders
::
_1
,
number
,
position
,
isFinger
,
tabletPadId
));
input
()
->
setLastInputHandler
(
this
);
}
bool
TabletInputRedirection
::
focusUpdatesBlocked
()
...
...
src/touch_input.cpp
View file @
7626dbb1
...
...
@@ -138,7 +138,7 @@ void TouchInputRedirection::processDown(qint32 id, const QPointF &pos, quint32 t
if
(
m_activeTouchPoints
.
count
()
==
1
)
{
update
();
}
m_lastEventTime
=
time
;
input
()
->
setLastInputHandler
(
this
)
;
input
()
->
processSpies
(
std
::
bind
(
&
InputEventSpy
::
touchDown
,
std
::
placeholders
::
_1
,
id
,
pos
,
time
));
input
()
->
processFilters
(
std
::
bind
(
&
InputEventFilter
::
touchDown
,
std
::
placeholders
::
_1
,
id
,
pos
,
time
));
m_windowUpdatedInCycle
=
false
;
...
...
@@ -153,7 +153,7 @@ void TouchInputRedirection::processUp(qint32 id, quint32 time, InputDevice *devi
if
(
!
m_activeTouchPoints
.
remove
(
id
))
{
return
;
}
m_lastEventTime
=
time
;
input
()
->
setLastInputHandler
(
this
)
;
m_windowUpdatedInCycle
=
false
;
input
()
->
processSpies
(
std
::
bind
(
&
InputEventSpy
::
touchUp
,
std
::
placeholders
::
_1
,
id
,
time
));
input
()
->
processFilters
(
std
::
bind
(
&
InputEventFilter
::
touchUp
,
std
::
placeholders
::
_1
,
id
,
time
));
...
...
@@ -172,7 +172,7 @@ void TouchInputRedirection::processMotion(qint32 id, const QPointF &pos, quint32
if
(
!
m_activeTouchPoints
.
contains
(
id
))
{
return
;
}
m_lastEventTime
=
time
;
input
()
->
setLastInputHandler
(
this
)
;
m_lastPosition
=
pos
;
m_windowUpdatedInCycle
=
false
;
input
()
->
processSpies
(
std
::
bind
(
&
InputEventSpy
::
touchMotion
,
std
::
placeholders
::
_1
,
id
,
pos
,
time
));
...
...
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