Skip to content

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

Merged
emilk merged 4 commits intoemilk:masterfrom
white-axe:wayland-ime
Mar 30, 2024
Merged

Fix continuous repaint on Wayland when TextEdit is focused or IME output is set#4269
emilk merged 4 commits intoemilk:masterfrom
white-axe:wayland-ime

Conversation

@white-axe
Copy link
Copy Markdown
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
Copy Markdown
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

@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
@emilk
Copy link
Copy Markdown
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
hacknus pushed a commit to hacknus/egui that referenced this pull request Oct 30, 2024
…put is not None (emilk#4269)

* Closes emilk#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>
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