-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
frame.set_window_size(ctx.used_size());
is broken
#403
Comments
Actually it comes from the code of the example I copied. frame.set_window_size(ctx.used_size()); I don't know why, but this does not work as expected. |
That snippet is unfortunately known to cause issues: e.g. #114 (comment) I also encountered it when I started using egui on Ubuntu-based Elementary OS--eventually I worked around it by only setting the size once. ObservationsAt the time I did investigate it a bit as I wondered if it was related to the resize events happening in the windowing back end. But I actually just revisited the issue today and my current thinking is that it seems like it may actually just be something within egui. The issue seems to be that there's some feedback loop that happens that causes the (height) value of I got a similar situation (using 0.11.0 currently) occurring when programatically setting the max height of a Possible workaround(s)One option for a workaround is to shrink Another approach would be only set the size once like here: #69 (comment) TroubleshootingAdditionally you could log the related values at the end of the
I haven't yet tried this with the standard hello world example to see the values it produces. Related links
Potentially related code areas to remind me for next time. :)
Edited: Added additional related links. |
frame.set_window_size(ctx.used_size());
is broken
Manually resizing the OS window makes the height of the window increase too much. It will even overflow the screen height, and can actually grow infinitely.
To Reproduce
Expected behavior
The height of the window should be conserved when resizing the window horizontally, and should increase slower when resizing the window vertically.
Screenshots
Desktop
The text was updated successfully, but these errors were encountered: