mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-17 07:16:12 +00:00
macos: moving some files around
This commit is contained in:
12
macos/Sources/Helpers/Extensions/NSWindow+Extension.swift
Normal file
12
macos/Sources/Helpers/Extensions/NSWindow+Extension.swift
Normal file
@@ -0,0 +1,12 @@
|
||||
import AppKit
|
||||
|
||||
extension NSWindow {
|
||||
/// Get the CGWindowID type for the window (used for low level CoreGraphics APIs).
|
||||
var cgWindowId: CGWindowID? {
|
||||
// "If the window doesn’t have a window device, the value of this
|
||||
// property is equal to or less than 0." - Docs. In practice I've
|
||||
// found this is true if a window is not visible.
|
||||
guard windowNumber > 0 else { return nil }
|
||||
return CGWindowID(windowNumber)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user