• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CGWindowListCopyWindowInfo(), how to pick relevant windows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CGWindowListCopyWindowInfo(), how to pick relevant windows


  • Subject: CGWindowListCopyWindowInfo(), how to pick relevant windows
  • From: Stefan Hafeneger <email@hidden>
  • Date: Thu, 14 Aug 2008 20:13:55 +0200

Hi,

I'm using the function CGWindowListCopyWindowInfo() to get a list of all visible windows since I want to do a hit test application wide. So my code is:

CGWindowListCopyWindowInfo(kCGWindowListOptionOnScreenOnly | kCGWindowListExcludeDesktopElements, kCGNullWindowID)

Afterwards I iterate over all windows (front to back) and check whether the point lies inside the window bounds. This works fine most of the time. But if the dock is set to "always visible" there is a fullscreen window (except the main menu) that belongs to the dock process. So the dock "grabs" all points when it is in always visible mode. (If I set a view to fullscreen, its NSFullScreenWindow is in front of the dock of course.)

Since I couldn't find much information concerning the dictionary values of CGWindowListCopyWindowInfo() I hope that someone of you has a hint. I don't just want to exclude any windows that belong to the dock. The window level may be a possibility, but I don't know up to which number a non-Apple can be. Maybe the workspace number would be another possibility but I'm not sure.

With best wishes, Stefan

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: crashing MacOs application when running a build file
  • Next by Date: AddressBook Record (Group/Person) ID: What's the best way to store ID in a NSDictionary?
  • Previous by thread: cocoa window in carbon?
  • Next by thread: AddressBook Record (Group/Person) ID: What's the best way to store ID in a NSDictionary?
  • Index(es):
    • Date
    • Thread