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

Unresponsive browser resizing #1500

Closed
emilk opened this issue Apr 15, 2022 · 6 comments · Fixed by #1503
Closed

Unresponsive browser resizing #1500

emilk opened this issue Apr 15, 2022 · 6 comments · Fixed by #1503
Labels
bug Something is broken web Related to running Egui on the web

Comments

@emilk
Copy link
Owner

emilk commented Apr 15, 2022

Resizing the browser window (Brave or Firefox, Mac) will not resize the egui canvas immediately, making resizing feel VERY laggy.

git bisect found out it was caused by #1306

@emilk emilk added bug Something is broken web Related to running Egui on the web labels Apr 15, 2022
@DusterTheFirst
Copy link
Contributor

It is very curious that the changes would affect performance, especially so much. The main change is the addition of an atomic Boolean which is slower than non-atomic operations, but I wouldn't see that causing a 10x slow down.

@emilk
Copy link
Owner Author

emilk commented Apr 15, 2022

No, it must be something far more serious, like the event not being registered or the needs_repaint flag not being set or read successfully.

Do you have time to take a look?

@DusterTheFirst
Copy link
Contributor

DusterTheFirst commented Apr 15, 2022

I think I found the culprit, It looks like the event handlers meant for the html element do not get registered. It can be seen in the screenshots that the canvas and the input elements have their event handlers registered, while the html element has no event handlers.

EDIT: This was caused by a silly copy-paste error where I accidentally put events for the window on the document

@kud1ing
Copy link
Contributor

kud1ing commented May 3, 2022

Moving the windows in the web demo has always been fast. To my surprise now on macOS it is very slow. It's not good in Firefox and unbearable in Safari. Can this be related?

@emilk
Copy link
Owner Author

emilk commented May 3, 2022

That sounds unrelated @kud1ing - please file an issue if you are having performance issues in a browser. Please note the difference between egui::Window, the browser window and the native winit::Window.

@kud1ing
Copy link
Contributor

kud1ing commented May 4, 2022

This may be only on my system. It's better after a reboot. Not sure why it's shows up now and only in the web demo.
I've been toying with it for a long time. Sorry for the probably false alarm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken web Related to running Egui on the web
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants