We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3136 - [PATCH] Call setlocale + XSetLocaleModifiers before XOpenIM (With ibus workaround)
Summary: [PATCH] Call setlocale + XSetLocaleModifiers before XOpenIM (With ibus workar...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.1
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-30 20:34 UTC by Alex Baines
Modified: 2016-10-11 20:15 UTC (History)
1 user (show)

See Also:


Attachments
Patch to fix various X11 input things (4.01 KB, patch)
2015-09-30 20:34 UTC, Alex Baines
Details | Diff
Fix for my setlocale mistake (1.00 KB, patch)
2016-10-03 14:41 UTC, Alex Baines
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Baines 2015-09-30 20:34:10 UTC
Created attachment 2281 [details]
Patch to fix various X11 input things

This patch calls setlocale(LC_ALL, "") and XSetLocaleModifiers before calling XOpenIM so that compose keys will work correctly. This fixes bug 3102 .

It also checks the XMODIFIERS for @im=ibus, and calls XSetLocaleModifiers with @im=none so that ibus is never used via XIM (The DBus implementation still works). This fixes bug 2526 .

It also re-enables the sending of KeyEvents that are filtered by XFilterEvents. This fixes bug 2071 .

It resets the locale back to whatever the user had it set to after XOpenIM was called.
Comment 1 Sam Lantinga 2016-10-01 21:09:39 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/2f18ea79bc03
Comment 2 Alex Baines 2016-10-03 14:41:57 UTC
Created attachment 2573 [details]
Fix for my setlocale mistake

Sorry, I tested the new hg with my patch applied in valgrind and I introduced an invalid read by invalidating the string returned by setlocale.

This new patch fixes that by storing it like it does for XSetLocaleModifiers.
Comment 3 Sam Lantinga 2016-10-11 20:15:34 UTC
Got it, thanks!
https://hg.libsdl.org/SDL/rev/01761b2d701e