agmmnn / tauri-controls

🚥 Native-looking window controls for Tauri 2. React, Solid, Vue, Svelte+Tailwind.
https://npmjs.com/package/tauri-controls
MIT License
581 stars 21 forks source link

[Windows] Support snap layout menu #26

Open Eatham532 opened 2 months ago

Eatham532 commented 2 months ago

Don't know how difficult it is to do this. But here is some documentation: https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/apply-snap-layout-menu

Gussy commented 3 weeks ago

This looks possible by emulating a Win+Z keypress for a middle mouse button click event.

A similar plugin does this with in Rust, triggered by a tauri command from the frontend: https://github.com/clearlysid/tauri-plugin-decorum/blob/main/src/commands.rs

Eatham532 commented 3 weeks ago

That looks pretty good. One downside to this method is that the menu covers the window controls.

WPF also has a similar issue with this and some people have ideas that could be tested. https://github.com/dotnet/wpf/issues/4825

Or maybe using something from this documentation: https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/apply-snap-layout-menu