fix: enabling previews with multiple screens could lead to flickering

This commit is contained in:
Ben Delaney authored and lwouis committed 2024-12-24 02:17:58 +01:00
1 parent c5e13ccc84
commit 87a2b219a5
1 file changed
+6
+6
View File
@@ -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
}
}
}