-
-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display windows from other Spaces #14
Comments
i'd like to bump this. i generally keep all my apps in full-screen, so this isn't uber useful until this enhancement is done. |
I checked and HyperSwitch has this feature. You can see at the bottom of the preferences UI here: I'll try to find a way to implement it. There is some interesting conversation in this StackOverflow thread. I can confirm that when removing Also note that for some mysterious reason, removing If anyone has an idea, please share it here :) |
I tested:
|
Would really like to see this feature. Use Spaces a lot... Thanks for this great software! |
Interesting discussion on the Rectangle project on why they don't support Spaces in general because there don't have public APIs. I've played today with private APIs from CGSPrivate.h and it seems that even these are now buggy let connection = _CGSDefaultConnection()
var workspace: Int32 = 0
CGSGetWindowWorkspace(connection, Int32(cgId), &workspace)
This tweet says that they stopped returning correct values in 10.8. WhichSpace uses This code gives list of spaces with their windows IDs (1 to 3 digit IDs): let connection = _CGSDefaultConnection()
let info = CGSCopyManagedDisplaySpaces(connection) as! [NSDictionary]
let displayInfo = info[0]
let activeSpaceID = (displayInfo["Current Space"]! as! NSDictionary)["ManagedSpaceID"] as! Int
let spaces = displayInfo["Spaces"] as! [NSDictionary]
for (index, space) in spaces.enumerated() {
// let spaceID = space["ManagedSpaceID"] as! Int
// let spaceNumber = index + 1
var setTags = UInt64(0)
var clearTags = UInt64(0x4000000000)
let spaceID64 = space["id64"] as! Int
let windows = CGSCopyWindowsWithOptionsAndTags(connection, 0, [spaceID64], 2, &setTags, &clearTags) as! NSArray
debugPrint(windows)
} I'm trying to find a lead on which tech to use to implement this feature, but it's very hard to find literature on this. The big projects like yabai, but look at the crazyness they have to go through:
They are basically doing extremely low-level and version-specific OS black magic. Also interesting to note how Catalina broke their app because of private APIs change. If we go the private API route to support this feature, we need to be ready to have a very challenging OS migration story... |
Interesting potential framework to switch spaces: https://github.com/bigbearlabs/SpaceSwitcher |
Got the honor to receive some tips from yabai's author Åsmund. He agreed for me to share our conversation here for others to learn from:
|
Just figured I'd let you know that there are private functions available to retrieve a list of windows per space and so on, without that space being active. The only information the API returns is basically a list of the CGWindowIds. I do not know if they return windows in any particular order, such as recently focused, which is of importance to you in this project. I might investigate this and report back after doing so. |
I would like to share an update. I've been exploring private APIs for the past couple weeks, and having very encouraging results. I've very close to completion. I will soon release a PR that delivers on the 3 most discussed tickets on this repo: alt-tab'ing to windows from other spaces (#14), minimized windows (#11), and better performance/responsiveness of the app (#45). Adding spaces support adds a huge scope:
Stay tuned! |
Also closes #11 closes #45 closes #62 BREAKING CHANGE: this brings huge changes to core parts of the codebase. It introduces the use of private APIs that hopefully are should be compatible from macOS 10.12+, but I couldn't test them. I reviewed the whole codebase to clean and improve on performance and readability
# [2.0.0](v1.14.4...v2.0.0) (2019-12-27) ### Features * display other spaces/minimized windows (closes [#14](#14)) ([3f5ea25](3f5ea25)), closes [#11](#11) [#45](#45) [#62](#62) ### BREAKING CHANGES * this brings huge changes to core parts of the codebase. It introduces the use of private APIs that hopefully are should be compatible from macOS 10.12+, but I couldn't test them. I reviewed the whole codebase to clean and improve on performance and readability
This ticket and a bunch of others are closed in v2 released today. Feel free to test that new version out and give feedback here! Hopefully you experience better performance, can interact with minimized windows, and interact with windows from other spaces and displays. Cheers! |
Hidden (cmd-h) windows are not showing up. |
@jackbravo i think you're the first one to point that out. I had actually never tested hidden windows before somehow 🙉 Could you please open a ticket for that? Maybe including comparison with alternative apps like HyperSwitch :) |
This is such great information! Is there a place where this research has been accumulated into one spot (all the private macOS APIs for doing this window management stuff)? I want to write Rust wrappers for these APIs to build more complex apps on top. |
@jkelleyrtp i've documented some stuff in the file called privateapi.swift i think. Also in various tickets here. Overall no it's all private effort clustered around projects. Contact the maintainers of top macOS project on these topics to learn more. We are a small community with less than 10 people really being knowledgeable about this arcane stuff |
There is a new API now in macOS 13+ called ScreenCaptureKit that makes capturing high FPS buffers of windows really efficient, see https://developer.apple.com/documentation/screencapturekit/capturing_screen_content_in_macos I use it in my own app Screegle https://www.appblit.com/screegle and noticed CPU usage is very very low. |
Currently windows from other spaces, including fullscreen'd windows that are in their own space, are not displayed in the thumbnails
The text was updated successfully, but these errors were encountered: