fix: enabling previews with multiple screens could lead to flickering
This commit is contained in:
1 parent
c5e13ccc84
commit
87a2b219a5
1 file changed
+6
@@ -40,6 +40,12 @@ class PreviewPanel: NSPanel {
|
||||
}
|
||||
currentId = id
|
||||
order(.below, relativeTo: App.app.thumbnailsPanel.windowNumber)
|
||||
// Despite using `previewPanel.order(.below)`, a z-ordering issue can occur in the following scenario:
|
||||
// 1. Show a preview of a window that is on a different monitor than the thumbnails panel
|
||||
// 2. Select a window in the switcher that is on the same monitor as the thumbnails panel, and whose position overlaps with the thumbnails panel
|
||||
// 3. For a single frame, the preview of the newly selected window can appear above the thumbnails panel before going back underneath it
|
||||
// Simply using order(.below) is not sufficient to prevent this brief flicker. We explicitly set the preview panel's window level to be one below the thumbnails panel
|
||||
App.app.previewPanel.level = App.app.thumbnailsPanel.level - 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user