[sddm-theme] Add virtual keyboard support
ClosedPublic

Authored by graesslin on Mar 15 2017, 7:28 PM.

Details

Summary

Just like in the lock screen this adds support for virtual keyboard.
Note: this requires adjustments in sddm, the greeter must specify the
env variable QT_IM_MODULE=qtvirtualkeyboard to have the virtual keyboard
shown.

If the virtual keyboard is not available, the button to enable it will
not be shown.

Test Plan

run in qmlscene

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin created this revision.Mar 15 2017, 7:28 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 15 2017, 7:28 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

- note the overlap with the clock will hardly be a problem in reality. It suffers from the same problem as the lockscreen, will upload a patch for it.

broulik added inline comments.
lookandfeel/contents/lockscreen/LockScreenUi.qml
202

Just set the source directly?

Alternatively, set the source directly alongside active: false and then set active true manually

sddm-theme/Main.qml
167

item && item.active ? item.implicitHeight : 0

graesslin updated this revision to Diff 12503.Mar 15 2017, 7:54 PM

Addressed Kai-Uwe's suggestions

graesslin marked an inline comment as done.Mar 15 2017, 7:56 PM
graesslin added inline comments.
lookandfeel/contents/lockscreen/LockScreenUi.qml
202

As that is in unrelated code: I'll do it in a separate change.

mart added a subscriber: mart.Mar 16 2017, 5:03 PM
mart added inline comments.
sddm-theme/Main.qml
125

they shouldn't show/hide themselves depending to the keyboard.
the keyboard should just slide over them and cover them if necessary

graesslin added inline comments.Mar 16 2017, 5:44 PM
sddm-theme/Main.qml
125

It looked really bad, that's why I went for hiding them. Somehow on the lock screen we seem to have a less crowded ui.

davidedmundson accepted this revision.Mar 22 2017, 10:06 AM
davidedmundson added a subscriber: davidedmundson.

FYI, SDDM requires only a config change. We added support a while back.

It's worth testing natively as opposed to qmlscene because components loading can be a bit weird because of paths.

/etc/sddm.conf

[General]
InputMethod=qtvirtualkeyboard

sddm-theme/Main.qml
173

I don't get what this property is all about?

Does Qt.inputMethod.visible start off true, and you're effectively making a work around that initial state?

This revision is now accepted and ready to land.Mar 22 2017, 10:06 AM

It's worth testing natively as opposed to qmlscene because components loading can be a bit weird because of paths.

will do! Wasn't aware that it's possible to use qtvirtualkeyboard already. That was the missing piece for testing.

FYI, SDDM requires only a config change. We added support a while back.

are you sure that works? I added the config and QT_IM_MODULE is not getting added to the environment of sddm-greeter. As I always doubt my own code I modified /etc/environment and added there the QT_IM_MODULE=qtvirtualkeyboard and that got picked up by sddm-greeter. Adding other values to the config worked, though. E.g. adding a CursorTheme entry got reflected in an updated XCURSOR_THEME env variable in sddm-greeter's environment.

and just for reference:

sddm --example-config
[Autologin]
# Whether sddm should automatically log back into sessions when they exit
Relogin=false

# Name of session file for autologin session (if empty try last logged in)
Session=

# Username for autologin session
User=


[General]
# Enable Qt's automatic high-DPI scaling
EnableHiDPI=true

# Halt command
HaltCommand=/bin/systemctl poweroff

# Input method module
InputMethod=qtvirtualkeyboard

yep, does not work: sddm/src/daemon/greeter.cpp - setting QT_IM_MODULE is only done in the branch if (daemonApp->testing())

I'm going to push nevertheless. A little bit sad, that it doesn't work OOTB, but well...

sddm-theme/Main.qml
173

yes. The input field has focus and that means it would request the virtual keyboard. So it would load with always virtual keyboard visible on startup. As that's (IMHO) a bad idea for a general default I decided to go for having to explicitly enable the virtual keyboard through the button. Thus the property in the VirtualKeyboard.qml.

This revision was automatically updated to reflect the committed changes.

Bah. Thanks for investigating. Ah well, you didn't expect it work OOTB anyway...so it's no worse, and I can get this into 0.14.1 rather than it being a new feature.

Upstream request.
https://github.com/sddm/sddm/pull/803

FYI, if you want to check via SDDM
sddm-greeter --test-mode --theme /opt/kde5/share/sddm/themes/breeze/

FYI, if you want to check via SDDM
sddm-greeter --test-mode --theme /opt/kde5/share/sddm/themes/breeze/

That one I had tried with the env variable and it worked fine.