Closed lukesmurray closed 3 years ago
If it's applicable I used app.mainWindow()
Thanks! Just to confirm understanding, what was the actual result and expected behaviour?
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.
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.
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. 🚀
@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!
@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!
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 tounminimize
it.