Skip to content

x11: Overhaul XIM code#451

Merged
august64 merged 2 commits intorust-windowing:masterfrom
august64:x11-xim-refresh
Apr 11, 2018
Merged

x11: Overhaul XIM code#451
august64 merged 2 commits intorust-windowing:masterfrom
august64:x11-xim-refresh

Conversation

@august64
Copy link
Copy Markdown
Member

@august64 august64 commented Apr 7, 2018

Fixes #195
Fixes #277
Fixes #455

  • Read XMODIFIERS explicitly/directly instead of calling XSetLocaleModifiers with an
    empty string. This is useful for debugging purposes, and more clear to read and handle.
  • Fallback to local input method if the one specified in XMODIFIERS is later closed on the
    server end (i.e. if ibus/fcitx is terminated). Previously, that would cause the event loop
    to freeze and usually also segfault.
  • If using the fallback input method, respond to the XMODIFIERS input method later
    becoming available. This means that the input method restarting is handled, and that even if
    the program was started while ibus/fcitx/etc. was unavailable, it will start using it as
    soon as it becomes available.
  • Only one input method is opened for the whole event loop, with each window having its own
    input context.
  • IME works completely out of the box now, no longer requiring application developers to
    call setlocale or XSetLocaleModifiers.
  • Detailed error messages are provided if no input method could be opened. However, no
    information is provided to the user if their intended XMODIFIERS input method failed to
    open but the fallbacks (which will ostensibly always succeed) succeeded; in my opinion, this
    is something that is best filled by adding a logging feature to winit.

Fixes rust-windowing#195
Fixes rust-windowing#277

* Read `XMODIFIERS` explicitly/directly instead of calling `XSetLocaleModifiers` with an
empty string. This is useful for debugging purposes, and more clear to read and handle.
* Fallback to local input method if the one specified in `XMODIFIERS` is later closed on the
server end (i.e. if ibus/fcitx is terminated). Previously, that would cause the event loop
to freeze and usually also segfault.
* If using the fallback input method, respond to the `XMODIFIERS` input method later
becoming available. This means that the input method restarting is handled, and that even if
the program was started while ibus/fcitx/etc. was unavailable, it will start using it as
soon as it becomes available.
* Only one input method is opened for the whole event loop, with each window having its own
input context.
* IME works completely out of the box now, no longer requiring application developers to
call `setlocale` or `XSetLocaleModifiers`.
* Detailed error messages are provided if no input method could be opened. However, no
information is provided to the user if their intended `XMODIFIERS` input method failed to
open but the fallbacks (which will ostensibly always succeed) succeeded; in my opinion, this
is something that is best filled by adding a logging feature to winit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

XIM: crash when restart fcitx5 Allow XOpenIM to return NULL? X11 input methods don't appear to work in example programs

1 participant