Skip to content

Commit

Permalink
fix: stage manager no longer skews the thumbnails (closes #1731)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwouis committed Feb 3, 2025
1 parent 69edbbd commit 93defcd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/api-wrappers/CGWindowID.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extension CGWindowID {
func screenshot() -> CGImage? {
// we use CGSHWCaptureWindowList because it can screenshot minimized windows, which CGWindowListCreateImage can't
var windowId_ = self
let list = CGSHWCaptureWindowList(CGS_CONNECTION, &windowId_, 1, [.ignoreGlobalClipShape, .bestResolution]).takeRetainedValue() as! [CGImage]
let list = CGSHWCaptureWindowList(CGS_CONNECTION, &windowId_, 1, [.ignoreGlobalClipShape, .bestResolution, .fullSize]).takeRetainedValue() as! [CGImage]
return list.first
// // CGWindowListCreateImage
// return CGWindowListCreateImage(.null, .optionIncludingWindow, self, [.boundsIgnoreFraming, .bestResolution])
Expand Down
2 changes: 2 additions & 0 deletions src/api-wrappers/private-apis/SkyLight.framework.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ struct CGSWindowCaptureOptions: OptionSet {
// on a retina display, 1px is spread on 4px, so nominalResolution is 1/4 of bestResolution
static let nominalResolution = CGSWindowCaptureOptions(rawValue: 1 << 9)
static let bestResolution = CGSWindowCaptureOptions(rawValue: 1 << 8)
// when Stage Manager is enabled, screenshots can become skewed. This param gets us full-size screenshots regardless
static let fullSize = CGSWindowCaptureOptions(rawValue: 1 << 19)
}

/// returns the connection to the WindowServer. This connection ID is required when calling other APIs
Expand Down

0 comments on commit 93defcd

Please sign in to comment.