Bug 267368 - x11/kf5-kded: does not save per-application keyboard layout settings anymore
Summary: x11/kf5-kded: does not save per-application keyboard layout settings anymore
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-26 16:58 UTC by Martin Birgmeier
Modified: 2024-02-20 19:29 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (kde)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Birgmeier 2022-10-26 16:58:19 UTC
Scenario:
- FreeBSD 12.3 latest
- ports as of Oct 13, specifically kf5-kded-5.98.0
- using "per-application" keyboard layout settings
- using "German (Austria)" for some (e.g., thunderbird), "English (US)" (which is also the default) for the rest
- normally, keyboard layout settings are saved into the file .local/share/kded5/keyboard/session/layout_memory.xml
- until a while ago, thunderbird seemed to use a WM_CLASS of "Thunderbird" (inferred from the contents of the layout_memory.xml file)
- currently, it uses "Mail", "thunderbird"
- The contents of the layout_memory.xml file were:

[0]% cat .local/share/kded5/keyboard/session/layout_memory.xml
<!DOCTYPE LayoutMap>
<LayoutMap version="1.0" SwitchMode="WinClass">
 <item currentLayout="at" layouts="us,at" ownerKey="Thunderbird"/>
 <item currentLayout="at" layouts="us,at" ownerKey="dolphin"/>
 <item currentLayout="at" layouts="us,at" ownerKey="okular"/>
 <item currentLayout="at" layouts="us,at" ownerKey="soffice.bin"/>
</LayoutMap>
[0]% 

Result:
- When logging in again, thunderbird gets the layout "English (US)"

Expected result:
- As for dolphin and okular, the layout should be remembered for thunderbird across session close/open.

Analysis:
- The file .local/share/kded5/keyboard/session/layout_memory.xml still gets read
- This can be seen by added the following line to it:

 <item currentLayout="at" layouts="us,at" ownerKey="thunderbird"/>

- (note the lower-case "t")
- With this line, after a new login (session) thunderbird immediately starts with the "German (Austria)" keyboard layout
- Obviously, on logout (or probably whenever the keyboard layout for an application is changed) the file is not updated anymore

-- Martin
Comment 1 Tobias C. Berner freebsd_committer freebsd_triage 2022-10-26 17:11:53 UTC
Moin moin Martin

This sounds like an upstream-bug at first glance. Could you open a bug-report at bugs.kde.org?


mfg Tobias
Comment 2 Martin Birgmeier 2022-10-28 05:41:54 UTC
https://bugs.kde.org/show_bug.cgi?id=461097
Comment 3 Gleb Popov freebsd_committer freebsd_triage 2024-02-20 18:56:35 UTC
Martin, is this still a problem?
Comment 4 Martin Birgmeier 2024-02-20 19:25:59 UTC
Hi Gleb, thanks for asking. Indeed it is - see the following scenario I just executed:

Scenario:
- KDE Gear 23.08.4, framworks 5.114.0, plasma 5.27.10, qt 5.15.12 = ports tree as of Feb. 10
- Logged into KDE
- Most applications set to US keyboard layout
- Thunderbird set to DE keyboard layout
- Change thunderbird to US keyboard layout

Result:
- The layout save file did not change:
[0]% ll .local/share/kded5/keyboard/session/layout_memory.xml
-rw-r--r--  1 martin bi 408 11 Nov. 16:57 .local/share/kded5/keyboard/session/layout_memory.xml
[0]% 

Scenario (continued):
- Use KDE "start button" and select "Herunterfahren" ("shutdown")
- Wait for complete power down
- Restart the computer and log in again

Result:
- Thunderbird uses the DE keyboard layout
- The layout save file is still unchanged:
[0]% ll .local/share/kded5/keyboard/session/layout_memory.xml
-rw-r--r--  1 martin bi 408 11 Nov. 16:57 .local/share/kded5/keyboard/session/layout_memory.xml
[0]% 

Conclusions:
- Changes to the layout are saved neither immediately nor when closing the session.
- I don't remember why the layout save file changed on Nov. 11; it is possible that I edited it manually.
- It could also be the case that sometimes it really records changes, but I am not sure about it, it would be very rare, and I do not know what could cause it.

-- Martin
Comment 5 Martin Birgmeier 2024-02-20 19:29:16 UTC
The current layout file looks like this; interestingly, its layout has changed compared to when I initially wrote the report.

[0]% cat .local/share/kded5/keyboard/session/layout_memory.xml
<!DOCTYPE LayoutMap>
<LayoutMap version="1.0" SwitchMode="WinClass">
 <item layouts="us,at" ownerKey="Thunderbird" currentLayout="at"/>
 <item layouts="us,at" ownerKey="dolphin" currentLayout="at"/>
 <item layouts="us,at" ownerKey="okular" currentLayout="at"/>
 <item layouts="us,at" ownerKey="soffice.bin" currentLayout="at"/>
 <item layouts="us,at" ownerKey="thunderbird" currentLayout="at"/>
</LayoutMap>
[0]%