开发者

OSX List of all Valid Open Windows in All Spaces?

I'm wondering if there's a way to reliably retrieve all open VALID windows in all spaces?

The problem I'm encountering now is that on programs like Microsoft Word for Mac there are lots of child windows, resulting in my list being muddied by blank windows with no title, or windows that just don't lead anywhere. For example, for Word I'm getting these 3 windows when I only have 1 document open:

  • Document 1
  • Microsoft Word
  • Desktop

All are from Microsoft Word,开发者_StackOverflow and same goes for Excel and Powerpoint, the problem seems to be pretty exclusive to the Microsoft Office suite. Any ideas on how to deal with windows that don't actually have anything?


You can try to correlate with Accessibility (you don't mention how you're getting the window list right now), or just use some heuristics (ignore windows with no title, no workspace number, look at the window tag bits, etc.). Pull up the window list in Quartz Debug, browse around and you'll see some differences. If the window is visible, you can also hold down Control-Option with Quartz Debug in the background to get a pop up HUD with some more detailed information about the window underneath the cursor.

If you're really desperate you could grab the window contents and see if they're all transparent or white.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜