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

Fix continuous repaint on Wayland when TextEdit is focused or IME output is set #4269

Merged
merged 4 commits into from
Mar 30, 2024

Conversation

white-axe
Copy link
Contributor

@white-axe white-axe commented Mar 30, 2024

Changes egui-winit so that it calls window.set_ime_cursor_area when the IME rect changes or the user interacts with the application instead of calling it every time the app is rendered. This works around a winit bug that causes the app to continuously repaint under certain circumstances on Wayland.

Tested on Wayland and on X11 using the text edit in the egui_demo_app - no changes in IME functionality as far as I can tell. Untested on non-Linux platforms.

Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, but please wait with applying pixels_per_point

crates/egui-winit/src/lib.rs Outdated Show resolved Hide resolved
@emilk emilk added eframe Relates to epi and eframe egui-winit porblems related to winit IME labels Mar 30, 2024
@emilk emilk merged commit 33221bd into emilk:master Mar 30, 2024
19 checks passed
@emilk
Copy link
Owner

emilk commented Mar 30, 2024

Thanks!

@white-axe white-axe deleted the wayland-ime branch March 30, 2024 16:17
emilk added a commit that referenced this pull request Apr 2, 2024
…put is not None (#4269)

* Closes #4254

Changes egui-winit so that it calls `window.set_ime_cursor_area` when
the IME rect changes or the user interacts with the application instead
of calling it every time the app is rendered. This works around a winit
bug that causes the app to continuously repaint under certain
circumstances on Wayland.

Tested on Wayland and on X11 using the text edit in the egui_demo_app -
no changes in IME functionality as far as I can tell. Untested on
non-Linux platforms.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
emilk added a commit that referenced this pull request Apr 2, 2024
…put is not None (#4269)

* Closes #4254

Changes egui-winit so that it calls `window.set_ime_cursor_area` when
the IME rect changes or the user interacts with the application instead
of calling it every time the app is rendered. This works around a winit
bug that causes the app to continuously repaint under certain
circumstances on Wayland.

Tested on Wayland and on X11 using the text edit in the egui_demo_app -
no changes in IME functionality as far as I can tell. Untested on
non-Linux platforms.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
@emilk emilk changed the title Fix continuous repaint on Wayland when TextEdit is focused or IME output is not None Fix continuous repaint on Wayland when TextEdit is focused or IME output is set Apr 2, 2024
@emilk emilk mentioned this pull request Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eframe Relates to epi and eframe egui-winit porblems related to winit IME
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On Wayland, app repaints every frame if IME output is set
2 participants