fix: stage manager no longer skews the thumbnails (closes #1731)

This commit is contained in:
lwouis committed 2025-02-03 11:25:47 +01:00
1 parent 69edbbdf42
commit 93defcd3a7
2 files changed
+3 -1

No files matched your search

+1 -1
View File
@@ -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])
@@ -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