Bug 390079 - System tray layout indicator does not show chosen layout under Wayland
Summary: System tray layout indicator does not show chosen layout under Wayland
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_keyboard_layout (show other bugs)
Version: 5.19.5
Platform: unspecified Linux
: HI major
Target Milestone: ---
Assignee: Andrey
URL: https://invent.kde.org/plasma/plasma-...
Keywords: wayland
: 391439 399861 (view as bug list)
Depends on:
Blocks: 418699 426450
  Show dependency treegraph
 
Reported: 2018-02-08 14:18 UTC by Nikolaos Kakouros
Modified: 2021-01-15 15:52 UTC (History)
22 users (show)

See Also:
Latest Commit:
Version Fixed In:
butirsky: Usability+
butirsky: VisualDesign+


Attachments
Chosen keyboard layout is still not displayed in system tray of neon unstable (26.74 KB, image/png)
2020-12-01 21:52 UTC, Patrick Silva
Details
keyboard layout applet showing label despite "Show flag" is selected in Keyboard applet (184.74 KB, image/png)
2020-12-09 11:53 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolaos Kakouros 2018-02-08 14:18:15 UTC
Steps to reproduce:
1. Have at least two layouts enabled in System Settings > Keyboard > Layouts
2. Select any of the radio options under System Settings > Keyboard > Layouts | Layout Indicator
3. Save
4. Switch language

Expected behavior:
The keyboard layout icon should change.

Actual Behavior:
The keyboard layout icon in the system tray stays the same.
Comment 1 Alexander Mentyu 2018-04-25 10:43:41 UTC
*** Bug 391439 has been marked as a duplicate of this bug. ***
Comment 2 Nicola Mori 2018-06-20 01:04:20 UTC
I confirm the issue is still present in Plasma 5.13.1.
Comment 3 Bogdan Lashkov 2018-08-28 11:51:22 UTC
I also confirm bug at plasma 5.13.4 in KDE neon based on 16.04 ubuntu
Comment 4 RussianNeuroMancer 2018-09-14 06:52:49 UTC
Still issue with 5.14 Beta.
Comment 5 Patrick Silva 2018-10-17 09:36:42 UTC
*** Bug 399861 has been marked as a duplicate of this bug. ***
Comment 6 alex 2019-11-17 14:06:59 UTC
Have the same issue in KDE 5.17.3
Comment 7 soredake 2020-07-17 13:09:09 UTC
Any progress on this?
Comment 8 Eugene 2020-07-17 19:36:08 UTC
(In reply to ruruoli from comment #7)
> Any progress on this?

Nope.8/
Comment 9 Andrey 2020-09-02 21:29:56 UTC
Hi, please note Keyboard Layout applet follows actual layout now: bug 425343.
I agree it's a pity it doesn't show the layout permanently though.
Comment 10 Eugene 2020-09-06 22:57:41 UTC
Just moved to Kubuntu 20.10 (dev branch)
Plasma: 5.19.5
Frameworks: 5.73.0
QT: 5.14.2

Layout switching is working but it is unknown which layout is active at the moment. Tray indicator still not displaying any useful info. It would be great if it would be fixed till 20.10 release.
Comment 11 Andrey 2020-11-24 13:51:38 UTC
Git commit a482d73de2911494ba3a0d89ada945fe4a28235f by Andrey Butirsky.
Committed on 24/11/2020 at 13:34.
Pushed by butirsky into branch 'master'.

feat: expose keyboard layout Short Name via DBus

Due space constraints, Short Name is the only name suitable for keyboard
layout indication on panels and systray. Usually it's just 2 symbols
corresponding to standard ISO country code.

libxkbcommon doesn't have this information, so we have to store it in
compositor for the exposing:
https://github.com/xkbcommon/libxkbcommon/issues/192

It's exposed by getLayoutDisplayName() DBus method now, as it should initially.
For Long Name, getCurrentLayoutLongName() method was added.

Relevant P-W commits:
Keyboard Layout plugin: passthrough Short Name from compositor to QML applet
fix: Keyboard Layout plugin: wrong property for passing Short Name
X11 part, P-D:
feat: expose keyboard layout Long Name via DBus
FEATURE:

M  +9    -1    keyboard_layout.cpp
M  +1    -0    keyboard_layout.h
M  +8    -2    xkb.cpp
M  +4    -0    xkb.h

https://invent.kde.org/plasma/kwin/commit/a482d73de2911494ba3a0d89ada945fe4a28235f
Comment 12 Andrey 2020-11-27 15:43:39 UTC
Git commit 343ad3bab21597f6fff898b27219d63408d59543 by Andrey Butirsky.
Committed on 27/11/2020 at 15:40.
Pushed by butirsky into branch 'master'.

fix: [1/2] Keyboard Layout applet: layout Name doesn't fit if variant is set

Layout variants were embedded in layout names as in "us(intl)".
Such name is too wide to fit in the applet.
Better just keep variants separate in their own config entry.
It's also a more structured and natural way to handle it.

KWin commit:
fix: [2/2] Keyboard Layout applet: layout Name doesn't fit if variant is set

M  +24   -9    kcms/keyboard/keyboard_config.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/343ad3bab21597f6fff898b27219d63408d59543
Comment 13 Andrey 2020-11-27 17:35:46 UTC
Git commit 2bac328cc8d5e61f46c30bc371688d517afb1eee by Andrey Butirsky.
Committed on 27/11/2020 at 17:35.
Pushed by butirsky into branch 'master'.

feat: QML Keyboard Layout applet: allow Short Name override

In parity with legacy layout Widget,
user can now override layout Short Name from KCM

FEATURE:

M  +10   -0    xkb.cpp

https://invent.kde.org/plasma/kwin/commit/2bac328cc8d5e61f46c30bc371688d517afb1eee
Comment 14 Andrey 2020-11-27 17:59:45 UTC
Git commit 6db2401a2810fd133df68f1a1715a821f91d63b3 by Andrey Butirsky.
Committed on 27/11/2020 at 17:59.
Pushed by butirsky into branch 'master'.

feat: expose keyboard layout Long Name via DBus

This is X11 part.

For Wayland,
KWin counterpart commit is:
feat: expose keyboard layout Short Name via DBus
FEATURE:

M  +7    -1    kcms/keyboard/keyboard_daemon.cpp
M  +1    -0    kcms/keyboard/keyboard_daemon.h

https://invent.kde.org/plasma/plasma-desktop/commit/6db2401a2810fd133df68f1a1715a821f91d63b3
Comment 15 Andrey 2020-11-27 18:34:29 UTC
Git commit 2fb63d8595b3b5c051d860b1c7b9a3b75f1130e5 by Andrey Butirsky.
Committed on 27/11/2020 at 13:29.
Pushed by butirsky into branch 'master'.

Keyboard Layout plugin: passthrough Short Name from compositor to QML applet

When layout changes, the country code (or short layout name) should be passed via DBus
from compositor to this C++ QML plugin, and then to a keyboard applet for
indication
KWin commit: "feat: expose keyboard layout Short Name via DBus"

M  +15   -105  components/keyboardlayout/keyboardlayout.cpp
M  +35   -43   components/keyboardlayout/keyboardlayout.h
M  +3    -0    components/keyboardlayout/org.kde.KeyboardLayouts.xml

https://invent.kde.org/plasma/plasma-workspace/commit/2fb63d8595b3b5c051d860b1c7b9a3b75f1130e5
Comment 16 Andrey 2020-11-27 18:44:38 UTC
Git commit b748d51cc08c055873f6463de7cd25ea91e281d0 by Andrey Butirsky.
Committed on 27/11/2020 at 18:42.
Pushed by butirsky into branch 'master'.

KeyboardLayoutButton.qml: add property for Long layout Name

make the component usable for systray applet implementation

FEATURE:
P-D commit: "Keyboard Layout applet"
https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/181

M  +19   -32   components/workspace/KeyboardLayoutButton.qml

https://invent.kde.org/plasma/plasma-workspace/commit/b748d51cc08c055873f6463de7cd25ea91e281d0
Comment 17 Andrey 2020-11-27 19:47:11 UTC
Git commit e2c5235790c84f84d375fd1d8ec3be2183e256f5 by Andrey Butirsky.
Committed on 27/11/2020 at 19:41.
Pushed by butirsky into branch 'master'.

Keyboard Layout applet

Unified (X11/Wayland) QML applet intended to replace existing C++ Widget solutions

P-W commit:
KeyboardLayoutButton.qml: add property for Long layout Name

CHANGELOG:

M  +1    -0    applets/CMakeLists.txt
A  +25   -0    applets/keyboardlayout/contents/ui/main.qml     [License: GPL(v2.0+)]
A  +19   -0    applets/keyboardlayout/metadata.desktop

https://invent.kde.org/plasma/plasma-desktop/commit/e2c5235790c84f84d375fd1d8ec3be2183e256f5
Comment 18 Andrey 2020-11-27 19:47:19 UTC
Git commit e2c5235790c84f84d375fd1d8ec3be2183e256f5 by Andrey Butirsky.
Committed on 27/11/2020 at 19:41.
Pushed by butirsky into branch 'master'.

Keyboard Layout applet

Unified (X11/Wayland) QML applet intended to replace existing C++ Widget solutions

P-W commit:
KeyboardLayoutButton.qml: add property for Long layout Name

CHANGELOG:

M  +1    -0    applets/CMakeLists.txt
A  +25   -0    applets/keyboardlayout/contents/ui/main.qml     [License: GPL(v2.0+)]
A  +19   -0    applets/keyboardlayout/metadata.desktop

https://invent.kde.org/plasma/plasma-desktop/commit/e2c5235790c84f84d375fd1d8ec3be2183e256f5
Comment 19 Patrick Silva 2020-12-01 21:52:56 UTC
Created attachment 133792 [details]
Chosen keyboard layout is still not displayed in system tray of neon unstable

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.20.80
KDE Frameworks Version: 5.77.0
Qt Version: 5.15.1
Comment 20 Andrey 2020-12-01 22:42:12 UTC
Thanks for reporting Patrick,
the change incorporates several parts - P-D, P-W and Kwin,
so Neon Unstable might just not absorb it all yet (my guess).
Also, could you paste your ~/.config/kxkbrc file?
Comment 21 Patrick Silva 2020-12-01 22:48:16 UTC
My ~/.config/kxkbrc file:

[Layout]
DisplayNames=
LayoutList=br,us
LayoutLoopCount=-1
Model=pc101
ResetOldOptions=false
ShowFlag=false
ShowLabel=true
ShowLayoutIndicator=true
ShowSingle=false
SwitchMode=Global
Use=true
VariantList=
Comment 22 Patrick Silva 2020-12-09 11:53:05 UTC
Created attachment 133946 [details]
keyboard layout applet showing label despite "Show flag" is selected in Keyboard applet

Currently only "Show label" mode is working.
The applet is still showing the label when "Show flag" or "Show label on flag"
mode is selected in Keyboard KCM.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.20.80
KDE Frameworks Version: 5.77.0
Qt Version: 5.15.2
Comment 23 Andrey 2020-12-09 16:21:21 UTC
It's not implemented currently.
Feel free to open a separate bug if you wish.
Comment 24 Andrey 2020-12-14 16:51:30 UTC
Git commit bc0b0adb0187b2bc174822cf9faf32ed2db0fb36 by Andrey Butirsky.
Committed on 14/12/2020 at 16:49.
Pushed by butirsky into branch 'master'.

feat: Keyboard Layout applet: switch layout by mouse wheel

In parity with legacy layout Widget

FEATURE:

M  +5    -0    components/keyboardlayout/keyboardlayout.cpp
M  +1    -0    components/keyboardlayout/keyboardlayout.h
M  +2    -0    components/keyboardlayout/org.kde.KeyboardLayouts.xml
M  +12   -0    components/workspace/KeyboardLayoutButton.qml

https://invent.kde.org/plasma/plasma-workspace/commit/bc0b0adb0187b2bc174822cf9faf32ed2db0fb36
Comment 25 Andrey 2020-12-31 12:20:49 UTC
Git commit 0676646ade672b78dbcb1a9f856da71a1a067760 by Andrey Butirsky.
Committed on 31/12/2020 at 12:20.
Pushed by butirsky into branch 'master'.

fix: keyboard variants display incorrectly on upgrade

Earlier, keyboard variants were embedded in layouts in config.
It is displayed incorrectly with new QML Keyboard Layout applet.

Now we need to update the config to split variants into separate
configuration entry.

The code is still compatible with the old format, but should be
refactored in the future.

Config update script sample:
	- Input:
	LayoutList=us,us(intl),ru,gb(dvorak),gb

	- Output:
	LayoutList=us,us,ru,gb,gb
	VariantList=,intl,,dvorak
	# DELETE LayoutList

M  +2    -0    kcms/keyboard/CMakeLists.txt
A  +4    -0    kcms/keyboard/kconf_update/CMakeLists.txt
A  +27   -0    kcms/keyboard/kconf_update/kxkb_variants.awk
A  +7    -0    kcms/keyboard/kconf_update/kxkb_variants.upd

https://invent.kde.org/plasma/plasma-desktop/commit/0676646ade672b78dbcb1a9f856da71a1a067760
Comment 26 David Edmundson 2021-01-07 23:58:26 UTC
Git commit c42525693b1ae3a0c0de48296c06a97231c626d5 by David Edmundson, on behalf of Andrey Butirsky.
Committed on 07/01/2021 at 23:58.
Pushed by davidedmundson into branch 'master'.

Remove a basic SNI for keyboard layout

Reverts major part of fe561c5c7def52320a045f938d0f0722fd7b473b

We now have platform-agnostic QML applet with superior functional, so
this one doesn't needed any more.

M  +0    -96   keyboard_layout.cpp
M  +0    -5    keyboard_layout.h
M  +0    -1    keyboard_layout_switching.cpp

https://invent.kde.org/plasma/kwin/commit/c42525693b1ae3a0c0de48296c06a97231c626d5
Comment 27 Andrey 2021-01-15 15:37:51 UTC
Git commit 6b673cfd71f136cf13982c1c5841edd195de48ad by Andrey Butirsky.
Committed on 15/01/2021 at 15:37.
Pushed by butirsky into branch 'master'.

feat: context menu for Keyboard Layout applet

It's in parity with legacy widget.
Flags in the menu are not supported yet.

Counterpart commit with the same title is in P-W

FEATURE:

M  +21   -2    applets/keyboardlayout/contents/ui/main.qml

https://invent.kde.org/plasma/plasma-desktop/commit/6b673cfd71f136cf13982c1c5841edd195de48ad
Comment 28 Andrey 2021-01-15 15:52:22 UTC
Git commit 0c65f91e9f19b34d92ed71e90d78ba2c3f1cd5b7 by Andrey Butirsky.
Committed on 15/01/2021 at 15:50.
Pushed by butirsky into branch 'master'.

feat: flags support for Keyboard Layout applet

This still relies on deprecated kdelibs4support library.
Should be ported to Emoji flags or standard-compliant theme:
https://invent.kde.org/frameworks/breeze-icons/-/issues/1
https://phabricator.kde.org/T13722

FEATURE:

A  +10   -0    applets/keyboardlayout/contents/config/config.qml  *
A  +12   -0    applets/keyboardlayout/contents/config/main.xml
A  +13   -0    applets/keyboardlayout/contents/ui/configGeneral.qml  *
M  +8    -5    applets/keyboardlayout/contents/ui/main.qml

The files marked with a * at the end have a non valid license. Please read: https://community.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.


https://invent.kde.org/plasma/plasma-desktop/commit/0c65f91e9f19b34d92ed71e90d78ba2c3f1cd5b7