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

isMinimized and unMinimize incorrect #269

Closed
lukesmurray opened this issue Feb 23, 2021 · 7 comments
Closed

isMinimized and unMinimize incorrect #269

lukesmurray opened this issue Feb 23, 2021 · 7 comments
Assignees
Labels
Milestone

Comments

@lukesmurray
Copy link

  • Version: Version 2.6.6 (95)
  • macOS: 10.15.7

Reproduced with slack, zoom, roam research, vscode.

To reproduce minimize an app then use a keyboard shortcut to query whether the app isMinimized and try to unminimize it.

@lukesmurray
Copy link
Author

If it's applicable I used app.mainWindow()

@kasper
Copy link
Owner

kasper commented Feb 24, 2021

Thanks! Just to confirm understanding, what was the actual result and expected behaviour?

@lukesmurray
Copy link
Author

lukesmurray commented Feb 24, 2021

After I minimize a window with the yellow minimize button I expect isMinimized to return true. Instead it returns false. Similarly if a window is minimized I expect unMinimize to return true. Instead it returns false. I ran into this issue because when you try to position or resize a minimized window you get a null reference error. I tried to unMinimize the window before positioning but since both isMinimized and unMinimize aren't working as expected I can't position or resize minimized windows.

@lukesmurray
Copy link
Author

If isMinimize is working on your machine it's possible this has to do with customizations I've done to my dock in which case I'll need to investigate a bit more.

@lukesmurray
Copy link
Author

Also thank you for this library. I know I've reported a couple of bugs but overall this is absolutely fantastic and a joy to work with. 🚀

@kasper
Copy link
Owner

kasper commented Feb 24, 2021

@lukesmurray Thanks for the details, I’ll look into this when I have time. These just make it even better. Thanks for the kind words!

@kasper kasper added the bug label Mar 21, 2021
@kasper kasper self-assigned this Mar 21, 2021
@kasper kasper added this to the 2.6.7 milestone Mar 21, 2021
kasper added a commit that referenced this issue Mar 21, 2021
…stance when the app is for example minimised. The function will now correctly return “undefined” in such cases (#269).
@kasper
Copy link
Owner

kasper commented Mar 21, 2021

@lukesmurray Hey, thanks for reporting this! This was partly expected behaviour and a bug at the same time. Long story short, a minimised app will not have a main window and this is why you experienced this behaviour. The App#mainWindow() now correctly returns undefined in such cases.

You should use App#windows() instead if you want to have this toggling behaviour, since it will always contain even minimised windows. Hope this helps!

@kasper kasper closed this as completed Mar 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants