-
Notifications
You must be signed in to change notification settings - Fork 124
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
Compose: allow overlapping sequences #398
base: master
Are you sure you want to change the base?
Compose: allow overlapping sequences #398
Conversation
The idea is to create nodes that contain the overlapping results using a previously unused slot. Possible enhancements:
It would be great to be able to test this in Qt apps to test the design, but I will not do it myself. |
I asked feedback to Qt devs. |
Not too happy with the |
95e8b5b
to
8f8d656
Compare
8f8d656
to
bbb3ca7
Compare
Currently xkbcommon does not support Compose overlapping sequences, unlike GTK and ibus. It means a sequence that is a prefix to a longer one is simply discarded with a warning. This is unfortunate: - There is discrepency for users of xkbcommon, e.g. Qt-based apps. - It is impossible to have a sequence that is the prefix of another one. As a consequence, if one imports e.g. the system locale Compose file (as many – most ? – custom Compose files do), some sequences become impossible. Example: I used `<Multi_key> <minus> <period> : "•" U2022` but upstream change in libX11 added `<Multi_key> <minus> <period> <e> : "ė̄"`, so I had to introduce an alternative sequence for Qt apps, although the previous one works in GTK-based apps. This commit introduces the new following API: - Macro `XKB_COMPOSE_HAS_OVERLAPPING_SEQUENCES_SUPPORT` to test overlapping sequences support at compile time via `#ifdef`. - `xkb_compose_compile_flags`: `XKB_COMPOSE_COMPILE_OVERLAPPING_SEQUENCES`: Allow overlapping sequences - `xkb_compose_status`: - `XKB_COMPOSE_CANDIDATE`: A complete sequence has been matched, but a longer sequence also exists. - `XKB_COMPOSE_CANDIDATE_ACCEPTED`: The last sequence was accepted due to an unmatched keysym.
bbb3ca7
to
ab79706
Compare
I sent a merge request in Qt. |
Motivation
Currently xkbcommon does not support Compose overlapping sequences,
unlike GTK and ibus. It means a sequence that is a prefix to a longer
one is simply discarded with a warning.
This is unfortunate:
There is discrepency for users of xkbcommon, e.g. Qt-based apps.
It is impossible to have a sequence that is the prefix of another one.
As a consequence, if one imports e.g. the system locale Compose file
(as many – most ? – custom Compose files do), some sequences become
impossible.
Example: I used
<Multi_key> <minus> <period> : "•" U2022
butupstream change in libX11 added
<Multi_key> <minus> <period> <e> : "ė̄"
,so I had to introduce an alternative sequence for Qt apps, although
the previous one works in GTK-based apps.
Proposed change
This commit introduces the new following API:
XKB_COMPOSE_HAS_OVERLAPPING_SEQUENCES_SUPPORT
to testoverlapping sequences support at compile time via
#ifdef
.xkb_compose_compile_flags
:XKB_COMPOSE_COMPILE_OVERLAPPING_SEQUENCES
: Allow overlapping sequencesxkb_compose_status
:-
XKB_COMPOSE_CANDIDATE
: A complete sequence has been matched, buta longer sequence also exists.
-
XKB_COMPOSE_CANDIDATE_ACCEPTED
: The last sequence was accepteddue to an unmatched keysym.
Fixes #395
NOTE: I intend to add the first two commits in #399. Will need to rebase once done.
Trying the patch
You can try it with
or replace
wayland
withx11
if relevant.Implementation in Qt
I asked feedback to Qt devs.
I sent also sent a merge request.