Skip to content
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

Windows shouldn't allow IME events when not editing text (On Desktop) #2614

Closed
liquidhelium opened this issue Jan 22, 2023 · 1 comment · Fixed by #3362
Closed

Windows shouldn't allow IME events when not editing text (On Desktop) #2614

liquidhelium opened this issue Jan 22, 2023 · 1 comment · Fixed by #3362
Labels
accessibility More accessible to e.g. the visually impaired bug Something is broken text Problems related to text

Comments

@liquidhelium
Copy link

Describe the bug
We can always enable or disable IME because IME is always allowed. In a typical application, this attribute should be determined by whether a text is being edited.

{
integration.init_accesskit(gl_window.window(), self.repaint_proxy.lock().clone());
}
let theme = system_theme.unwrap_or(self.native_options.default_theme);
integration.egui_ctx.set_visuals(theme.egui_visuals());
gl_window.window().set_ime_allowed(true);
if self.native_options.mouse_passthrough {
gl_window.window().set_cursor_hittest(false).unwrap();
}

wgpu_render_state.clone(),
);
#[cfg(feature = "accesskit")]
{
integration.init_accesskit(&window, self.repaint_proxy.lock().unwrap().clone());
}
let theme = system_theme.unwrap_or(self.native_options.default_theme);
integration.egui_ctx.set_visuals(theme.egui_visuals());
window.set_ime_allowed(true);
{
let event_loop_proxy = self.repaint_proxy.clone();
integration.egui_ctx.set_request_repaint_callback(move || {

To Reproduce
Steps to reproduce the behavior:

  1. You'll need to have a input method editor.
  2. Start a native egui app (on web it works fine) and you'll find that you can call up the IME when not editing (even there's no textedit).

Expected behavior
When editing, IME is allowed; Disallowed otherwise.

Screenshots
IME is on it's initial position.
(IME is on it's initial position.)

Desktop (please complete the following information):

  • OS: Windows 22H2 (Windows 11)

Additional context
There's a field mutable_text_under_cursor in egui::output::PlatformOutput.

currently it's used by eframe web, but it should also applicable to egui_winit or other crates.

@liquidhelium liquidhelium added the bug Something is broken label Jan 22, 2023
@emilk emilk added accessibility More accessible to e.g. the visually impaired text Problems related to text labels Feb 8, 2023
@Barugon
Copy link
Contributor

Barugon commented Jul 30, 2023

if [gl_]window.set_ime_allowed was called with true when a text edit gained focus and called with false when that text edit lost focus then the on-screen keyboard would properly show and hide on Linux devices like PinePhone and Librem 5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility More accessible to e.g. the visually impaired bug Something is broken text Problems related to text
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants