

I'm not fluent in Swift so I cannot really help with the code at this point, but I can definitely test it here on my machine when you have something working with your test app. But you have the test app where you can figure this out. The tricky part is to determine if a window is parent window / has child windows.
#Install xtrafinder windows
AltTab UI would display two child Finder windows without frames and when selected TotalFinder would get activated and focus would properly go to the left or right side depending on which Finder window was selected. This would work pretty well even in dual mode. I agree with your point that in general maybe you want to treat child windows as separate windows and make special case for TotalFinder and XtraFinder only.Ī) if window belongs to Finder process and window has some child windows and window has no parent window => do not display it in AltTab UI Finder windows are hacked to ignore dragging and instead redirect dragging to the parent window. Finder is unaware of this, it still thinks it has separate windows, but TotalFinder does this trick to turn them into child windows and compose them over its own parent window. It has one parent window which renders tab and two "glued on" Finder windows on the left and right side (with removed borders). In this case TotalFinder is in dual mode. And one TotalFinder window with tabs, window framing and gray background. In AltTab UI you see two Finder windows without frames.

Please look at this more explanatory screenshot: I lay original Finder window on top of background "framing" TotalFinder window to achieve tabbed interface. Thanks for the effort in making a test app and the video.
#Install xtrafinder free
var_38 appears to be a plain C array of CG window IDs (don't forget to free it) and var_2C appears to be the count. So in theory you should be able to use CGSCopyWindowGroup with magic "movementGroup" to detect parent-child relationships. I looked at the disassembly of AppKit framework and they are doing something like this. If CGSGetParentWindowList is not helpful. (I guess you don't want to implement this functionality by hand, I mean by taking screenshots of all windows in the parent-child hierarchy, consulting CG private APIs for their relative positions and compositing them by hand). I know that may be slower than your current method but this method should give you a composite screenshot of the window and all its child windows recursively.

when taking a screenshot of a window which has some child windows you probably have to fall back to CGWindowListCreateImage.in user selection do not show windows which have some parent window ( CGSGetParentWindowList should give you answer wheter particular window is a child window or not).So from what I saw in your code you need to modify two things: and maybe some others, I think CGSGetParentWindowList looks like interesting method However, it is important to note that this is then an issue that the developer(s) of said application should consider a bug in their application.Įdit: There are also private APIs to detect if a window has a parent-window, which I assume would be the case for this particular TotalFinder window, by looking at the screenshot in the first post.Įxtern CGError CGSAddWindowToWindowMovementGroup(const CGSConnection cid, CGSWindow wid, CGSWindowMovementGroup group) Įxtern CGError CGSRemoveWindowFromWindowMovementGroup(const CGSConnection cid,ĬGSWindow wid, CGSWindowMovementGroup group) Of course this has the inverse issue, where applications that report the wrong role by mistake is not classified correctly as a real window when it should be, and I have a system in place that will allow the user to specify these using various filters. In your case there might be other roles that should be considered valid windows, such as AXDialog etc. Windows on macOS should report a kAXWindowRole of AXWindow, and kAXWindowSubrole
