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

Add window events (resized, maximized) and getters #1523

Closed
WilliamVenner opened this issue Apr 17, 2021 · 1 comment
Closed

Add window events (resized, maximized) and getters #1523

WilliamVenner opened this issue Apr 17, 2021 · 1 comment

Comments

@WilliamVenner
Copy link
Contributor

Is your feature request related to a problem? Please describe.
It's not possible to save the user's preference of window size or maximization.

Describe the solution you'd like
Rust window events that fire when the window is resized or maximized.

Describe alternatives you've considered
I have looked into detecting window maximization via JavaScript but it is impossible.

Currently JavaScript's onresize event is satisfactory to save the user's preferred window size.

Additional context
tauri-winit has a Window::is_maximized function on Windows and macOS:

https://github.com/rust-windowing/winit/blob/dabcb1834d4f2c6761854d911ec17f1f01e3cc10/src/platform_impl/windows/window.rs#L414

https://github.com/rust-windowing/winit/blob/629cd86c7cc674c40c1f20b992bdd13784f357dd/src/platform_impl/macos/window.rs#L747

However, Linux seems to be unimplemented:

https://github.com/rust-windowing/winit/blob/ca9c05368e76f70a06cdc34b864711584e5744c2/src/platform_impl/linux/mod.rs#L382

A PR seems to have implemented it, but it's been sitting around since February. Looks like you guys made the right decision to make your own winit branch!

rust-windowing/winit#1848

lucasfernog added a commit that referenced this issue May 5, 2021
lucasfernog added a commit that referenced this issue May 6, 2021
@lucasfernog
Copy link
Member

Maximized event will be implemented when tao provides it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants