phoenix icon indicating copy to clipboard operation
phoenix copied to clipboard

Windows of zero size should be ignored

Open sindresorhus opened this issue 3 years ago • 2 comments

  • Version: 3.0.0
  • macOS: macoS 12.4

My app has a helper window that is 0x0 in size. It cannot be made invisible because of SwiftUI limitations. I think Phoenix should ignore such windows.

Reproduce:

  • Config:
    console.log(Window.all({visible: true}).map(x => x.title() + ' - ' + x.size().width + ' - ' + x.size().height).join('\n'));
    
  • Install: https://sindresorhus.com/folder-peek
  • Run log stream --process Phoenix
  • Notice how Folder Peek - 0 - 0 is logged.

sindresorhus avatar May 21 '22 08:05 sindresorhus

@sindresorhus Hmm! 🤔 This is a good observation, my initial feeling is that we should leave the filtering to the user of the API. Then again you could state that we could automatically filter this if the visible optional is true.

kasper avatar May 26 '22 18:05 kasper

I don't see how returning such windows to the user would ever be useful. For example, each menu bar item is made up by a window, so with that logic, you should include all those windows too. However, this is just my recommendation as a Mac developer. I don't use this app, so I have nothing invested in the conclusion of this. The incompatibility was just reported to me by @mafredri.

sindresorhus avatar May 27 '22 03:05 sindresorhus