Bug 466969

Summary: Tapping Virtual Keyboard button doesn't make the virtual keyboard appear on SDDM (Wayland)
Product: [Plasma] kwin Reporter: Marc Deop <kde>
Component: virtual-keyboardAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: aleixpol, nate
Priority: NOR Keywords: wayland
Version: 5.27.2   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=467209
Latest Commit: Version Fixed In: 5.27.3
Sentry Crash Report:

Description Marc Deop 2023-03-06 20:16:03 UTC
STEPS TO REPRODUCE
1. Start computer to SDDM
2. Press the "Virtual Keyboard" button on the lower left corner

OBSERVED RESULT
Nothing seems to happen

EXPECTED RESULT
The virtual keyboard shows up (same as if I touched an input field with the touchscreen)

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.27.2
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Comment 1 Marc Deop 2023-03-07 22:11:15 UTC
I forgot to mention this only happens on Wayland
Comment 2 Nate Graham 2023-03-08 04:26:09 UTC
Can reproduce with SDDM in native Wayland mode, not in X11 mode (where it still shows the QtVirtualKeyboard) in both test more and also real use.

Looks like the SDDM theme part is doing its part, but when we get to the bit where we call `Keyboards.KWinVirtualKeyboard.enabled = true`, Maliit doesn't appear.
Comment 3 Aleix Pol 2023-03-08 12:30:22 UTC
Is it when you use the mouse that it doesn't appear? My guess is that it's the "was it triggered by a touch event?" feature  that is getting in the way.

I'd been trying to debug this yesterday, but I'm getting hit by an unrelated issue that wouldn't let me.
Comment 4 Marc Deop 2023-03-08 12:33:43 UTC
(In reply to Aleix Pol from comment #3)
> Is it when you use the mouse that it doesn't appear? My guess is that it's
> the "was it triggered by a touch event?" feature  that is getting in the way.
> 
> I'd been trying to debug this yesterday, but I'm getting hit by an unrelated
> issue that wouldn't let me.

No. The virtual keyboard never shows when I press/click/touch the button via mouse, touchpad or touchscreen.
Comment 5 Nate Graham 2023-03-08 14:46:18 UTC
Same. As a data point, when I press the button with my finger in SDDM's test mode, the full-screen SDDM greeter window resizes to be only half-screen, making room for where the Maliit keyboard *would* be. But it never appears to fill that space.
Comment 6 Bug Janitor Service 2023-03-09 03:50:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3783
Comment 7 Aleix Pol 2023-03-09 03:51:36 UTC
This one is necessary if you dismiss the keyboard by swiping...
https://github.com/maliit/keyboard/pull/187
Comment 8 Aleix Pol 2023-03-09 14:30:10 UTC
Git commit d34cf36bfaadd39fcc6893379a0d8d8326031eea by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 09/03/2023 at 14:18.
Pushed by apol into branch 'master'.

inputmethod: Show the input method even if it was dismissed

Reset the current context in case we receive a show() event from the
client, meaning that they really want to see that virtual keyboard.

M  +2    -0    src/inputmethod.cpp

https://invent.kde.org/plasma/kwin/commit/d34cf36bfaadd39fcc6893379a0d8d8326031eea
Comment 9 Aleix Pol 2023-03-09 15:26:36 UTC
Git commit 8fefef61849c58ca74e50cf09a6fcc15639cf087 by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 09/03/2023 at 14:36.
Pushed by apol into branch 'Plasma/5.27'.

inputmethod: Show the input method even if it was dismissed

Reset the current context in case we receive a show() event from the
client, meaning that they really want to see that virtual keyboard.


(cherry picked from commit d34cf36bfaadd39fcc6893379a0d8d8326031eea)

M  +2    -0    src/inputmethod.cpp

https://invent.kde.org/plasma/kwin/commit/8fefef61849c58ca74e50cf09a6fcc15639cf087
Comment 10 Marc Deop 2023-03-10 10:14:14 UTC
Unfortunately the patches do not seem to work for me :(

I have Frameworks 5.104.0 (with the latest re-spin), kwin 5.27.2 with added patches (https://download.copr.fedorainfracloud.org/results/@kdesig/kde/fedora-37-x86_64/05619797-kwin/) the specific lines (from the spec file):
## upstream patches
Patch1: make-sure-input-backends-are-initialised-when-the-workspace-is-set-up.patch
Patch2: show-the-input-method-even-if-it-was-dismissed.patch

I also have patched maliit-keyboard: https://koji.fedoraproject.org/koji/taskinfo?taskID=98502688

Do we perhaps need the other commits I can see on kwin's side of things? or perhaps other commits on maliit-keyboard?
Comment 11 Aleix Pol 2023-03-10 16:45:19 UTC
Git commit cab6b844422aab0072db840123cc3207b338564b by Aleix Pol Gonzalez, on behalf of Aleix Pol i Gonzalez.
Committed on 10/03/2023 at 16:19.
Pushed by apol into branch 'Plasma/5.27'.

sddm-theme: Transfer the focus to the text field as we show the OSK

Borrowed from the lockscreen, we need to make sure the correct component
is focussed, otherwise the Virtual Keyboard cannot find its purpose.

M  +6    -1    lookandfeel/sddm-theme/Main.qml

https://invent.kde.org/plasma/plasma-workspace/commit/cab6b844422aab0072db840123cc3207b338564b
Comment 12 Aleix Pol 2023-03-10 16:52:23 UTC
Git commit e7c7a0688418f8111760b9fdfe09c3ddb1c1c88f by Aleix Pol, on behalf of Aleix Pol i Gonzalez.
Committed on 10/03/2023 at 16:52.
Pushed by apol into branch 'master'.

sddm-theme: Transfer the focus to the text field as we show the OSK

Borrowed from the lockscreen, we need to make sure the correct component
is focussed, otherwise the Virtual Keyboard cannot find its purpose.

M  +6    -1    lookandfeel/sddm-theme/Main.qml

https://invent.kde.org/plasma/plasma-workspace/commit/e7c7a0688418f8111760b9fdfe09c3ddb1c1c88f
Comment 13 Marco Martin 2024-04-05 11:25:53 UTC
Git commit 4580d0437735f895993e3b7ccbec2b942b195e99 by Marco Martin, on behalf of Aleix Pol i Gonzalez.
Committed on 05/04/2024 at 11:25.
Pushed by mart into branch 'master'.

sddm-theme: Transfer the focus to the text field as we show the OSK

Borrowed from the lockscreen, we need to make sure the correct component
is focussed, otherwise the Virtual Keyboard cannot find its purpose.

M  +6    -1    Main.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/4580d0437735f895993e3b7ccbec2b942b195e99