Skip to content

On Wayland, app repaints every frame if IME output is set #4254

@white-axe

Description

@white-axe

Describe the bug
On Linux with Wayland, when an egui app using eframe has ui.output(|o| o.ime) not equal to None, the app continuously repaints.

One example of when ui.output(|o| o.ime) is not None is when an egui::widgets::TextEdit is focused because it is set by the widget in order to allow IMEs to determine where the cursor is.

I haven't tested this on non-Linux machines, but WebAssembly apps in browsers on Linux don't seem to have this problem, nor do apps for Windows running in Wine on Linux. Linux with X11 doesn't have this problem either.

To Reproduce
Steps to reproduce the behavior:

  1. Clone egui and checkout to the 0.27.0 tag
  2. cargo run -p egui_demo_app
  3. Make sure "Backend" is selected in the top-left corner of the app so that the left pane is visible
  4. Set the rendering mode to "Reactive" in the left pane so that the app doesn't repaint unless it has to
  5. Focus the text edit in the widget gallery or any other text edit
  6. Observe that the "Mean CPU usage" in the left pane constantly updates, meaning the app is repainting every frame

Expected behavior
The app should not repaint every frame when the text edit is selected.

Desktop (please complete the following information):

  • OS: Arch Linux with GNOME 46
  • Version: Linux unknown 6.8.1-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Sat, 16 Mar 2024 17:15:23 +0000 x86_64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    IMEbugSomething is brokennative-linuxProblem specific to Linux

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions