Post

Replies

Boosts

Views

Activity

Reply to Window in all spaces
let window : NSWindow? = nil ... window?.collectionBehavior = .canJoinAllSpaces // window will be in all Spaces window?.collectionBehavior = .moveToActiveSpace // when window is activated, move to active Space window?.collectionBehavior = .stationary // Expose doesn't affect window, so it stays visible and stationary, like the Desktop window window?.collectionBehavior = .managed // window participates in Spaces and Expose (i.e. normal window). there are other options....
Topic: Programming Languages SubTopic: Swift Tags:
May ’22
Reply to How to identify the first desktop (space)?
There doesn't appear to be any public API to do this. Searching GitHub, there are some codes that do this, but they are using non-public API (e.g. using CGSCopyManagedDisplaySpaces)
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to Window in all spaces
let window : NSWindow? = nil ... window?.collectionBehavior = .canJoinAllSpaces // window will be in all Spaces window?.collectionBehavior = .moveToActiveSpace // when window is activated, move to active Space window?.collectionBehavior = .stationary // Expose doesn't affect window, so it stays visible and stationary, like the Desktop window window?.collectionBehavior = .managed // window participates in Spaces and Expose (i.e. normal window). there are other options....
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to CGWindowListCreateImage doesn't *always* return the correct image
Thanks for your response. https://feedbackassistant.apple.com/feedback/9824294 By definition the bug only occurs occasionally. Gave a link to the code and the line to comment out to get the problem to appear. Unfortunately, there is no deterministic way to reproduce.
Topic: Graphics & Games SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to CGWindowListCreateImage doesn't *always* return the correct image
One clue is when the code starts, it always captures the Desktop background images correctly. It seems to fail only when the NSWorkspace.activeSpaceDidChangeNotification is sent. Introducing a block for 0.25 seconds seems to insure the image capture succeeds. Would prefer a better option than blocking.
Topic: Graphics & Games SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’21