mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-07 03:48:14 +00:00
Let SDL_IM_MODULE=fcitx override Wayland as a workaround to fix key repetition detection (#11859)
This commit is contained in:
@@ -2184,6 +2184,18 @@ void Wayland_add_primary_selection_device_manager(SDL_VideoData *d, uint32_t id,
|
|||||||
|
|
||||||
void Wayland_add_text_input_manager(SDL_VideoData *d, uint32_t id, uint32_t version)
|
void Wayland_add_text_input_manager(SDL_VideoData *d, uint32_t id, uint32_t version)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_FCITX
|
||||||
|
const char *im_module = SDL_getenv("SDL_IM_MODULE");
|
||||||
|
if (im_module && SDL_strcmp(im_module, "fcitx") == 0) {
|
||||||
|
/* Override the Wayland text-input protocol when Fcitx is enabled, like how GTK_IM_MODULE does.
|
||||||
|
*
|
||||||
|
* The Fcitx wiki discourages enabling it under Wayland via SDL_IM_MODULE, so its presence must
|
||||||
|
* be intentional, and this workaround is needed for fixing key repeat detection.
|
||||||
|
*/
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
d->text_input_manager = wl_registry_bind(d->registry, id, &zwp_text_input_manager_v3_interface, 1);
|
d->text_input_manager = wl_registry_bind(d->registry, id, &zwp_text_input_manager_v3_interface, 1);
|
||||||
|
|
||||||
if (d->input) {
|
if (d->input) {
|
||||||
|
Reference in New Issue
Block a user