Integrate the normal keyboard layout switcher
Needs ReviewPublic

Authored by apol on Oct 8 2019, 3:41 PM.

Details

Summary

This deprecates the SNI from KWin in favour of this plasmoid that will
allow doing the same as well as managing the different IME tech we
support.

This also changes the default panel layout to include kimpanel since it
will be useful in any language.

Related to D12069 and D14796

Test Plan

I can switch between catalan and american keyboard, if ibus
is running I can do the same but through ibus.

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
apol created this revision.Oct 8 2019, 3:41 PM
Restricted Application added a project: Plasma. · View Herald TranscriptOct 8 2019, 3:41 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
apol requested review of this revision.Oct 8 2019, 3:41 PM
apol updated this revision to Diff 67513.Oct 8 2019, 3:45 PM

Remove unused function

apol updated this revision to Diff 67514.Oct 8 2019, 3:48 PM

Send a sensible font size

Makes sense, there's a lot of red and it's about to lead to more.

I like that.

applets/kimpanel/package/contents/ui/main.qml
45–47

anchors.fill

layout-templates/org.kde.plasma.desktop.defaultPanel/contents/layout.js
38

Do we also need a plasma upgrade script if we remove the SNI from kded/kwin

broulik added a subscriber: broulik.Oct 8 2019, 4:14 PM

Do we need an update script to add this plasmoid to all existing setups?

apol added inline comments.Oct 8 2019, 5:59 PM
layout-templates/org.kde.plasma.desktop.defaultPanel/contents/layout.js
38

I'd say so. We can do it when we deprecate the SNI though, unless you really want it now. I've never done it so I'll have to research how it's done.

hein added a subscriber: hein.EditedOct 12 2019, 10:29 AM

It's a small part of the work Geon Park did in his GSoC project to refactor kimpanel and our input sources management in general, but in a more merge-friendly format.

The former sadly never got any review attention because the patch was too big, so maybe this is the right way to make progress.

For context though, in the GSoC the following work was done:

  • The keyboard layout KCM was rewritten in Qt Quick
  • It's based on a model that can contain both IMEs and keyboard layouts
  • The model can dynamically react to IME daemons coming and going and doing a sensible fallback
  • The implementation is shared between the KCM, kimpanel (which, like here, replaces the old SNI) and the kded module that on X11 provides the D-Bus API to manage layouts
  • That means global shortcuts like Next/Prev Keyboard Layout we have work over both IMEs and layouts
  • That means the OSD and the lock screen show the right thing and became IME-aware

And a couple of other things. What wasn't done was touch KWin/Wayland (which in a Plasma/Wayland session provides the same D-Bus API kded provides on X11).

So it's important to remember that this is the goal. With this patch Plasma would get better, but it doesn't address the whole problem (System Settings being useless for IMEs, the IME daemon making System Settings useless when running, two incompatible systems fighting each other, expert knowledge required to set things up in the first place, etc).

I'm very excited to see this because it indicates more interest growing in the problem domain, so maybe we can review and merge that other body of work down the line after all.

apol added a comment.Oct 12 2019, 2:43 PM

I don't claim to solve the whole problem, it's just a step forward.

This revision was not accepted when it landed; it landed in state Needs Review.Oct 14 2019, 2:15 PM
This revision was automatically updated to reflect the committed changes.
apol reopened this revision.Oct 15 2019, 3:28 PM
apol added a comment.Oct 15 2019, 3:57 PM

This got landed by arc together with another patch. I didn't mean to land it.

mart added a subscriber: mart.Oct 16 2019, 9:15 AM
In D24503#545961, @hein wrote:

For context though, in the GSoC the following work was done:

  • The keyboard layout KCM was rewritten in Qt Quick

Can that work be resumed/used?

apol added a comment.Oct 16 2019, 10:57 AM

Can that work be resumed/used?

See D14796. It seems like the original author is MIA. I rebased the patch, seems to work but adopting it will set us back as the ibus backend was never implemented.

I'd say so. We can do it when we deprecate the SNI though, unless you really want it now. I've never done it so I'll have to research how it's done.

I don't want it to get forgotten and us to do work in a rush when the release comes along.


As for the other IM work, that was the state when I originally wanted to port this layout item (T5331) 2.5 years ago. Doing everything all at once isn't an approach that seems to be working.
Having the kimpanel on by default and dropping the SNI from the kded/kwin seems like it's a step that would be needed anyway, so this is work towards that end goal even if this specific plasmoid does end up getting replaced.

From my POV, ship it.

bam added a subscriber: bam.Oct 13 2020, 8:59 PM