diff --git a/src/logic/Window.swift b/src/logic/Window.swift index 024e8cd0..3a65e883 100644 --- a/src/logic/Window.swift +++ b/src/logic/Window.swift @@ -95,9 +95,10 @@ class Window { } func refreshThumbnail() { - guard let cgWindowId = cgWindowId, let cgImage = cgWindowId.screenshot() else { return } - thumbnail = NSImage(cgImage: cgImage, size: NSSize(width: cgImage.width, height: cgImage.height)) - thumbnailFullSize = thumbnail!.size + if !isWindowlessApp, let cgWindowId = cgWindowId, cgWindowId != -1, let cgImage = cgWindowId.screenshot() { + thumbnail = NSImage(cgImage: cgImage, size: NSSize(width: cgImage.width, height: cgImage.height)) + thumbnailFullSize = thumbnail!.size + } } func close() {