fix: window preview was not showing in titles style
This commit is contained in:
1 parent
dfff608ad1
commit
684cc666d3
4 files changed
+8
-6
No files matched your search
@@ -173,8 +173,9 @@ class Windows {
|
||||
}
|
||||
|
||||
static func previewFocusedWindowIfNeeded() {
|
||||
if Preferences.previewFocusedWindow && !Preferences.onlyShowApplications()
|
||||
&& App.app.appIsBeingUsed && App.app.thumbnailsPanel.isKeyWindow,
|
||||
if App.app.appIsBeingUsed && SystemPermissions.screenRecordingPermission == .granted
|
||||
&& Preferences.previewFocusedWindow && !Preferences.onlyShowApplications()
|
||||
&& App.app.thumbnailsPanel.isKeyWindow,
|
||||
let window = focusedWindow(),
|
||||
let id = window.cgWindowId,
|
||||
let thumbnail = window.thumbnail,
|
||||
@@ -303,7 +304,6 @@ class Windows {
|
||||
|
||||
// dispatch screenshot requests off the main-thread, then wait for completion
|
||||
static func refreshThumbnails(_ windows: [Window], _ onlyUpdateScreenshots: Bool) {
|
||||
if Appearance.hideThumbnails { return }
|
||||
var eligibleWindows = [Window]()
|
||||
for window in windows {
|
||||
if !window.isWindowlessApp, let cgWindowId = window.cgWindowId, cgWindowId != CGWindowID(bitPattern: -1) {
|
||||
|
||||
@@ -77,7 +77,7 @@ private func touchEventHandler(_ cgEvent: CGEvent) -> Bool {
|
||||
class GestureDetector {
|
||||
static func convertEvent(_ cgEvent: CGEvent) -> NSEvent? {
|
||||
var nsEvent: NSEvent?
|
||||
// convertion has to happen on the main-thread, or appkit will crash
|
||||
// conversion has to happen on the main-thread, or appkit will crash
|
||||
DispatchQueue.main.sync {
|
||||
nsEvent = NSEvent(cgEvent: cgEvent)
|
||||
}
|
||||
|
||||
+3
-1
@@ -198,7 +198,9 @@ class App: AppCenterApplication {
|
||||
}
|
||||
|
||||
func refreshOpenUi(_ windowsToScreenshot: [Window], skipUpdatesBeforeShowing: Bool = false, onlyUpdateScreenshots: Bool = false) {
|
||||
if !Appearance.hideThumbnails && !windowsToScreenshot.isEmpty && SystemPermissions.screenRecordingPermission == .granted {
|
||||
if !windowsToScreenshot.isEmpty && SystemPermissions.screenRecordingPermission == .granted
|
||||
&& !Preferences.onlyShowApplications()
|
||||
&& (!Appearance.hideThumbnails || Preferences.previewFocusedWindow) {
|
||||
Windows.refreshThumbnails(windowsToScreenshot, onlyUpdateScreenshots)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class PreviewPanel: NSPanel {
|
||||
}
|
||||
|
||||
func show(_ id: CGWindowID, _ preview: NSImage, _ position: CGPoint, _ size: CGSize) {
|
||||
if id != currentId {
|
||||
if previewView.image != preview {
|
||||
previewView.image = preview.copyToSeparateContexts()
|
||||
previewView.image!.size = size
|
||||
var frame = NSRect(origin: position, size: size)
|
||||
|
||||
Reference in new issue
Block a user