Skip to content

Commit 5ea81ef

Browse files
kchibisovnotgull
authored andcommitted
x11: add workaround for disabling IME on gnome
GNOME doesn't list that there's a _NONE_ style at all, but it still works if you use it.
1 parent 6896de5 commit 5ea81ef

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/changelog/unreleased.md

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ changelog entry.
7171
- Added `Window::safe_area`, which describes the area of the surface that is unobstructed.
7272
- On X11, Wayland, Windows and macOS, improved scancode conversions for more obscure key codes.
7373
- Add ability to make non-activating window on macOS using `NSPanel` with `NSWindowStyleMask::NonactivatingPanel`.
74+
- On X11, add a workaround for disabling IME on GNOME.
7475

7576
### Changed
7677

src/platform_impl/linux/x11/ime/input_method.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ impl InputMethod {
8282
}
8383

8484
let preedit_style = preedit_style.unwrap_or_else(|| none_style.unwrap());
85-
let none_style = none_style.unwrap_or(preedit_style);
85+
// Always initialize none style even when it's not advertised, since it seems to work
86+
// regardless...
87+
let none_style = none_style.unwrap_or(Style::None(XIM_NONE_STYLE));
8688

8789
Some(InputMethod { im, _name: name, preedit_style, none_style })
8890
}

0 commit comments

Comments
 (0)