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

Let user determines, what events are important for rerendering #5387

Open
Arash-Rezaie opened this issue Nov 19, 2024 · 2 comments
Open

Let user determines, what events are important for rerendering #5387

Arash-Rezaie opened this issue Nov 19, 2024 · 2 comments
Labels
eframe Relates to epi and eframe feature New feature or request

Comments

@Arash-Rezaie
Copy link

When I move mouse even out of the egui window, rerender happens while in version 26.x it was correct. It is a bug, but let user determines what events are important.

@lucasmerlin
Copy link
Collaborator

There already is App::raw_input_hook, it'd be nice to maybe extend that to return a boolean/enum and we only repaint if the bool is true or alternatively add a check after raw_input_hook to see if the list of events is now empty we can skip the repaint (if the reason for it was a native event and not e.g. request_repaint)

@lucasmerlin lucasmerlin added feature New feature or request eframe Relates to epi and eframe labels Nov 20, 2024
@barries
Copy link

barries commented Dec 6, 2024

Avoiding mouse movement renders for a GUI that doesn't do hover at all would nice (tm).

As for the raw_input_hook(...) -> bool idea, that sounds great--another similar thing that would also be handy is to be able to do an early return from App::update() because our code uses Context::request_repaint_after() to poll hardware every 100ms and it would be nice to skip the render if hardware hasn't changed state.

For context, the hardware we're polling is a positioning motor in a medical device that spends most of its time sitting still while the surgeon does other things. Or making these schedule renders call raw_input_hook() (or does it already do that? I don't see an obvious Event variant for that, so I assume it doesn't).

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 feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants