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

Expose Window::{min,max}_inner_size to get the window contraints #3185

Open
kchibisov opened this issue Oct 25, 2023 · 5 comments
Open

Expose Window::{min,max}_inner_size to get the window contraints #3185

kchibisov opened this issue Oct 25, 2023 · 5 comments
Labels
D - easy Likely easier than most tasks here S - api Design and usability

Comments

@kchibisov
Copy link
Member

This should help with limiting the window sizes to something meaningful as well as query for the set_{min,max}_inner_size respectively.

@kchibisov kchibisov added S - api Design and usability D - easy Likely easier than most tasks here labels Oct 25, 2023
@dhardy
Copy link
Contributor

dhardy commented Oct 25, 2023

You mean as a PhysicalSize?

@kchibisov
Copy link
Member Author

All winit APIs to get size of a window are in PhysicalSize, there's no API to get anything in logical size iirc.

@dhardy
Copy link
Contributor

dhardy commented Oct 25, 2023

Ugh, barring a fix to #2275 it sounds like the only way to use this is to create the window then resize it.

@kchibisov
Copy link
Member Author

@dhardy that's how wayland works, yes. But there's nothing wrong to create a window, you just get the initial state, until you draw you don't apply a new state. So you have all the rights to limit everything.

Winit can clamp the with_inner_size though due to configure_bounds internally, that's what it can be doing. given that you're on KDE I can create a patch doing so, so it can constraint the window for you automatically.

@dhardy
Copy link
Contributor

dhardy commented Oct 25, 2023

Sounds good. BTW I observed that WindowBuilder::max_inner_size does not apply to inner_size; I guess that should also clamp the size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D - easy Likely easier than most tasks here S - api Design and usability
Development

No branches or pull requests

2 participants