-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrong layouts number returned with lv3:ralt_alt option #262
Comments
With lv3:ralt_alt ("Right Alt never chooses 3rd level") option set, we get more layouts from libxkbcommon than it was configured, see xkbcommon/libxkbcommon#262 It might be correct lib's behavior, still. The extra layouts are redundant, so we stream them out from usual usage. BUG: 440027
With lv3:ralt_alt ("Right Alt never chooses 3rd level") option set, we get more layouts from libxkbcommon than it was configured, see: xkbcommon/libxkbcommon#262 It might be correct lib's behavior, still. The extra layouts are redundant, so we strip them out from usual usage. BUG: 440027
With lv3:ralt_alt ("Right Alt never chooses 3rd level") option set, we get more layouts from libxkbcommon than it was configured, see: xkbcommon/libxkbcommon#262 It might be correct lib's behavior, still. The extra layouts are redundant, so we strip them out from usual usage. BUG: 440027
With lv3:ralt_alt ("Right Alt never chooses 3rd level") option set, we get more layouts from libxkbcommon than it was configured, see: xkbcommon/libxkbcommon#262 It might be correct lib's behavior, still. The extra layouts are redundant, so we strip them out from usual usage. BUG: 440027
@whot @bluetech We are doubt if this is a bug of xkbcommon or not. Could you help us to find a best way to go? |
With lv3:ralt_alt ("Right Alt never chooses 3rd level") option set, we get more layouts from libxkbcommon than it was configured, see: xkbcommon/libxkbcommon#262 It might be correct lib's behavior, still. The extra layouts are redundant, so we strip them out from usual usage. BUG: 440027
With lv3:ralt_alt ("Right Alt never chooses 3rd level") option set, we get more layouts from libxkbcommon than it was configured, see: xkbcommon/libxkbcommon#262 It might be correct lib's behavior, still. The extra layouts are redundant, so we strip them out from usual usage. BUG: 440027
With lv3:ralt_alt ("Right Alt never chooses 3rd level") option set, we get more layouts from libxkbcommon than it was configured, see: xkbcommon/libxkbcommon#262 It might be correct lib's behavior, still. The extra layouts are redundant, so we strip them out from usual usage. BUG: 440027 (cherry picked from commit 59143ee)
verified with |
Thanks for looking! |
What I can see it's by design, no? keymap.h
keymap.c
xkbcomp/keymap.c
|
The way keymaps works is that you may have multiple groups but a key can have a single group only - because it's the same across all groups (or only defined in one group). For example, the space key usually works like the former:
so those comments don't necessarily agree or disagree with the behaviour in this bug (the first two at least). |
Would it be correct fix then to define Group1 only for the key in config?:
|
IIRC the issue was that the XKB rules syntax lacked any notion of applying an option to all groups. So selecting |
Any thoughts about the proper fix then? PS: |
So, best I can tell from a short run through the code, this was added in 428c6f3 though as part of a larger rework. The key comment here is xkbcomp only calls My guess right now is that this behavior is incorrect, it just didn't trigger any real bug so far. From a short skim through xkeyboard-config that particular option seems to be the only one that relies on this particular behaviour - defining four groups and hoping the excessive ones get silently dropped.
A possible solution but I'm running out of time to check this further today:
as well as commenting out the later line for
So basically: special case that option to it applies to the groups one-by-one. This now gives me the correct keymap with libxkbcommon and xkbcomp. I think this may be the correct solution, regardless of any libxkbcommon fix. But I need to page a lot more code back in to be sure. @fooishbar? |
I've filed this in https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/merge_requests/253. I think libxkbcommon still needs to be fixed too though but this will no longer trigger the bug. |
Many thanks from KDE community! :) 🎉 |
Seems I faced similar issue again, but now it's that PS: might be relevant: I opened a separate issue about this: |
From comment above:
@whot I observed that xkb_symbols "ralt_alt" {
key <RALT> {
type[Group1]="TWO_LEVEL",
type[Group2]="TWO_LEVEL",
type[Group3]="TWO_LEVEL",
type[Group4]="TWO_LEVEL",
symbols[Group1] = [ Alt_R, Meta_R ],
- symbols[Group2] = [ Alt_R, Meta_R ],
+ symbols[Group2] = [ Alt_R, Alt_R ],
- symbols[Group3] = [ Alt_R, Meta_R ],
+ symbols[Group3] = [ Alt_R, Meta_L ],
- symbols[Group4] = [ Alt_R, Meta_R ]
+ symbols[Group4] = [ Alt_L, Meta_R ]
};
modifier_map Mod1 { <RALT> };
}; So we could add this extra step to mimic the There are 2 properties at our disposal to detect if the parsed file is a whole keymap or an included file for a `specific* group:
We could use 2) to raise a warning though, and add this warning detection to Also, when compiling a keymap from RMLVO names, we do know exactly how many groups are expected, so we could pass this info to the parser and discard:
This solution with RMLVO names seems robust and can be combined with the warning of the previous section. |
I implemented a fix for the first item in #518; it turns out that the second item does have legit use case, such as legacy rules inserting an US layout before a non-Latin one. |
The behavior produces a crash of KWin on Wayland currently, making it impossible to start a session:
https://bugs.kde.org/show_bug.cgi?id=440027
Here is the relevant part of /usr/share/X11/xkb/symbols/level3:
This option causing
xkb_keymap_num_layouts()
to return 4, despite the fact we requested only 2 layouts when creating the context withxkb_keymap_new_from_names()
. The problem is we currently assume the former can't increase the latter.The same configuration produces different internal keymap for KWin on X11 and Wayland (which uses libxkbcommon):
X11 (taken as xkbcomp $DISPLAY out.xkb):
vs
xkbcommon (Wayland):
We don't understand yet which one is right, but probably these two should be the same?
The text was updated successfully, but these errors were encountered: