New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: don't set delegate for QLPreviewPanel
#37530
fix: don't set delegate for QLPreviewPanel
#37530
Conversation
}); | ||
|
||
w.previewFile(__filename); | ||
await setTimeout(500); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't figure out a great way to test this without adding another internal event just for testing. I also tried await waitUntil(() => !w.isFocused());
but that didn't wait long enough for the second show
.
I would have also liked to create a test with another window covering the QuickLook window but that doesn't work either.
QLPreviewPanel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree it'd be nice to have another test but what you added is probably the reasonable best w/o adding another event as you mentioned so i'm good to move this forward as-is!
Release Notes Persisted
|
I have automatically backported this PR to "22-x-y", please check out #37576 |
I have automatically backported this PR to "23-x-y", please check out #37577 |
I have automatically backported this PR to "24-x-y", please check out #37578 |
Description of Change
Fixes #37476
The QuickLook NSWindow's delegate is set to the same object as the delegate for the BrowserWindow's NSWindow here. The delegate's handler for windowDidChangeOcclusionState doesn't seem to expect handling events for the QuickLook window, and so when the QuickLook window becomes occluded, it assumes that the BrowserWindow has been occluded.
There's a similar issue for other NSWindowDelegate methods besides windowDidChangeOcclusionState. So resizing/moving the QuickLook window will cause the BrowserWindow's resize/will-resize/resized/move/will-move/moved events to fire.
The code has moved around a bit but I think this may have existed since BrowserWindow.previewFile was added in 2016 in #7592. FYI @lauracpierre @zcbenz @bengotow
Checklist
npm test
passesRelease Notes
Notes: Fixed issue with BrowserWindow not updating after call to previewFile.