Port Keyboard input modules and Expand scope to cover input method configuration
Needs ReviewPublic

Authored by gpark on Aug 13 2018, 3:34 PM.

Details

Summary

This is the result of this year's GSoC project.

Users of Plasma Desktop Environment expect to find all their necessary system configurations through the System Settings application. So it plays an important role for the overall user experience of Plasma. But the current application is largely designed using the legacy QWidget framework, and does not meet the requirements for more responsive / modern design required for use in touch screens and mobile platforms. For that, it is necessary to port the KCMs to Qt Quick, which is quite tedious work and requires a lot of manpower. My primary goal is to help the KDE Community in this immense task, by porting the keyboard input modules, with modern designs provided by the KDE Visual Design Group (VDG).

Another additional goal is to integrate the input method configurations, such as ibus or fcitx, into the System Settings application. Currently, the only way to install / configure these input methods is to install it from a package manager and use the GUI provided by the input method, which is far from discoverable. The ability to add / remove and configure IMEs will improve user experience for a global audience.

In the patch, there are three major changes/additions:

  1. Keyboard layout switching is now handled by the keyboard kded daemon plugin
  1. New QAbstractListModel-based keyboard layout model encompassing fcitx, and extensible to other IMEs
  1. Kimpanel applet updated to operate with the new model

Diff Detail

Repository
R119 Plasma Desktop
Branch
new_keyboard_kcm
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 1790
Build 1808: arc lint + arc unit
gpark created this revision.Aug 13 2018, 3:34 PM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 13 2018, 3:34 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
gpark requested review of this revision.Aug 13 2018, 3:34 PM
gpark changed the visibility from "Public (No Login Required)" to "No One".Aug 13 2018, 6:07 PM
gpark updated this revision to Diff 39628.Aug 13 2018, 6:33 PM
  • Remove outdated tests
  • Merge branch 'new_keyboard_kcm' of git.kde.org:clones/plasma-desktop/gpark/gsoc-kcm-keyboard-revamp into new_keyboard_kcm
  • comment out unimplemented feature
gpark edited the summary of this revision. (Show Details)Aug 13 2018, 6:36 PM
gpark edited the summary of this revision. (Show Details)
gpark changed the visibility from "No One" to "All Users".
gpark changed the visibility from "All Users" to "Public (No Login Required)".
apol added a subscriber: apol.Oct 22 2018, 4:24 PM

What's the status of this? The longer we wait, the harder it will be to integrate. We just branched 5.14, maybe it's time to consider doing so?

hein added a comment.Oct 23 2018, 5:37 AM
In D14796#347289, @apol wrote:

What's the status of this? The longer we wait, the harder it will be to integrate. We just branched 5.14, maybe it's time to consider doing so?

It needs a lot of review, VDG feedback on the KCM UIs, and practically speaking an ibus backend to be coded. Both Geon and me are currently a bit busy (exchange studies in his case, work in my case) and I think much progress before Xmas isn't that likely unless more people participate.

If this patch can, practically speaking, be applied and used, I'm happy to offer some UI review, and I suspect other VDG folks would, too. If not, screenshots would be helpful. :)

This redesign seems like a good place to start thinking about integrating accessibility options T8888 with the rest of the settings. I included some screenshots of what OSX does (Switch Control, Accessibility Keyboard, Dwell for head- and eye-tracking and Panel Editor to edit)

I tried to test this out, but it doesn't apply to master anymore. Applying and then rebasing on master results in a ton of merge conflicts. :(

Is there any movement on this? It would be a real shame to let such a huge amount of valuable work rot away. Even just rebasing it on current master would be helpful since then people could test it out without having to roll back to Plasma 5.13. @gpark, are you around to continue this work?

hein added a comment.Jan 23 2019, 3:08 PM

@gpark just came back from an exchange semester. We met the other day and will schedule a work session in Feb to resume on this.

Fantastic news!

This fails to build now.

The longer we wait, the harder it will be to integrate

So true.

hein added a comment.Oct 12 2019, 10:35 AM

Ping @gpark, are you available to resume work on this too? There's a growing amount of interest which means more dev hands to aid the effort.

apol added a comment.Oct 16 2019, 12:53 AM

So I decided to rebase the patch onto current master. I pushed it rebased into a branch called apol/D14796 because I didn't know whether to take over this review.

I would appreciate it if someone could help me tell why it wasn't merged. I see:

It needs a lot of review, VDG feedback on the KCM UIs, and practically speaking an ibus backend to be coded. Both @gpark and me are currently a bit busy (exchange studies in his case, work in my case) and I think much progress before Xmas isn't that likely unless more people participate.

KCM uis is something we can polish even after the fact. @eikehein, you have made it clear that you believe this is the way to go. I can see into helping making this a thing but I need to know that even if the ibus backend is there this won't be stalled forever.

Thanks @apol
I've built it from your branch and testing it now. Here is a list of issues I have faced so far:

  1. Layout switch doesn't work on Lock screen. Visually layouts are shown as switched, but actually it's always English.
  2. I have 3 layouts: EurKey, Russian and Mozc (fcitx). All work fine except for normal layouts are not indicated in tray with their respective names (ru, eu). When switching to Mozc, it's icon shows up as expected.
  3. Switching laouts with "Main shift key" (like Alt+Shift or Win+Space) only works for ru<->eu, mozc isn't triggered, although "Cycle through layouts" shortcut (Ctrl+Alt+K as by default) allows switching to Mozc.
  4. This is of course more of design thing but adding new layout is such a pain now: the dialog window is small, list area inside is tiny, searching for "Russian" shows huge amount of possible variants and to find and select a needed one is not a simple task, given the fact that the scrollbar is small and navigation with keyboard arrow keys is not possible.
  5. Each layout in Keyboard kcm has its settings invoked by "Configure" button, but when trying to configure Mozc this way its dialog appears blank, then entire systemsettings5 segfaults:
$ systemsettings5
Icon theme "elementary" not found.
Icon theme "elementary" not found.
QVariant(FcitxQtInputMethodItemList, )
Icon theme "elementary" not found.
"grp" "Switching to another layout"
"lv3" "Key to choose the 3rd level"
QQmlExpression: Expression file:///home/openm/kde/usr/share/kpackage/kcms/kcm_keyboard/contents/ui/Layouts.qml:187:13 depends on non-NOTIFYable properties:
    LayoutConfigModel::thirdLevelShortcutModel
QQmlExpression: Expression file:///home/openm/kde/usr/share/kpackage/kcms/kcm_keyboard/contents/ui/Layouts.qml:173:13 depends on non-NOTIFYable properties:
    LayoutConfigModel::mainShiftKeyModel
"Keyboard model \"\" not detected"
file:///home/openm/kde/usr/lib/qml/org/kde/kirigami.2/templates/InlineMessage.qml:136: TypeError: Value is undefined and could not be converted to an object
file:///home/openm/kde/usr/lib/qml/org/kde/kirigami.2/private/globaltoolbar/PageRowGlobalToolBarUI.qml:71: TypeError: Cannot read property 'actions' of null
file:///home/openm/kde/usr/lib/qml/org/kde/kirigami.2/templates/AbstractApplicationHeader.qml:46:5: Unable to assign QQuickItem_QML_136 to Page_QMLTYPE_28
file:///home/openm/kde/usr/lib/qml/org/kde/kirigami.2/private/globaltoolbar/BreadcrumbControl.qml:71:21: Unable to assign QQuickItem_QML_136 to Page_QMLTYPE_28
QQmlEngine::setContextForObject(): Object already has a QQmlContext
kcm_touchpad: Using X11 backend
QQmlEngine::setContextForObject(): Object already has a QQmlContext
qml: Touchpad configuration of device '1 : ETD2303:00 04F3:3083 Touchpad' opened
"eu" false ""
"ru" false ""
"fcitx:mozc" false ""
"1 instead of 2 arguments to message {The input support fo...} supplied before conversion."
"eu"
0
Cannot open config description file
Cannot open config description file
fish: “systemsettings5” terminated by signal SIGSEGV (Address boundary error)

In order to have fcitx working I used to have .pam_environment with the following content:

XMODIFIERS=@im=fcitx
GTK_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
DefaultIMModule=fcitx

I don't know if I still need it.

My overall impression is there's lot of things to polish but in general this is a huge step in the right direction.
I am ready to test it anytime.