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

MacOS minimize support #983

Closed
chrisduerr opened this issue Jun 25, 2019 · 4 comments
Closed

MacOS minimize support #983

chrisduerr opened this issue Jun 25, 2019 · 4 comments
Labels
C - needs discussion Direction must be ironed out DS - macos S - api Design and usability S - enhancement Wouldn't this be the coolest?

Comments

@chrisduerr
Copy link
Contributor

This has been reported to Alacritty in alacritty/alacritty#2534.

Currently winit exposes an API on all platforms to set the window visibility using the set_visible method. If this is called on macOS, the window is hidden without adding it to the dock, this is working as intended.

However, on macOS a different method of hiding windows exists too, this is called miniaturize in their docs which makes the window invisible and adds it to the dock. I believe this is what happens when the minimize button is clicked in the window decorations, but as far as I can tell there's no way to call this explicitly from winit.

The generated cocoa-rs bindings provide this method on NsWindow. So I think it should be relatively trivial to implement this using the WindowsExtMacOS, since I don't think it's available in this fashion on any other platform.

Alternatively, this could be declared as out of scope, so downstream consumers would have to use the ns_window call instead to do this themselves.

@felixrabe
Copy link
Contributor

I think that's perfectly in scope. I just looked at https://docs.rs/winit/0.20.0-alpha1/winit/window/struct.Window.html because I wondered whether this could not be handled by some platform-independent set_minimized method. Turns out, there isn't one.

@felixrabe
Copy link
Contributor

felixrabe commented Jun 26, 2019

Related: #783 (Minimizing window on Windows causes WindowEvent::Resized(size=0) event).
Related: #208 (Need to get info about window state)

@felixrabe
Copy link
Contributor

Opened #985 (Add Window::set_minimized method) about the missing method.

@goddessfreya goddessfreya added DS - macos S - api Design and usability S - enhancement Wouldn't this be the coolest? C - needs investigation Issue must be confirmed and researched C - needs discussion Direction must be ironed out and removed C - needs investigation Issue must be confirmed and researched labels Jun 26, 2019
@kchibisov
Copy link
Member

I guess this bug should be closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C - needs discussion Direction must be ironed out DS - macos S - api Design and usability S - enhancement Wouldn't this be the coolest?
Development

No branches or pull requests

4 participants