fix: don't set delegate for QLPreviewPanel
(#37530)
fix: don't set delegate for QLPreviewPanel
This commit is contained in:
parent
e480cb7103
commit
bf1cc1aeb2
2 changed files with 16 additions and 2 deletions
|
@ -276,12 +276,10 @@ void SwizzleMouseDown(NSView* frame_view,
|
|||
}
|
||||
|
||||
- (void)beginPreviewPanelControl:(QLPreviewPanel*)panel {
|
||||
panel.delegate = [self delegate];
|
||||
panel.dataSource = static_cast<id<QLPreviewPanelDataSource>>([self delegate]);
|
||||
}
|
||||
|
||||
- (void)endPreviewPanelControl:(QLPreviewPanel*)panel {
|
||||
panel.delegate = nil;
|
||||
panel.dataSource = nil;
|
||||
}
|
||||
|
||||
|
|
|
@ -5275,6 +5275,22 @@ describe('BrowserWindow module', () => {
|
|||
w.closeFilePreview();
|
||||
}).to.not.throw();
|
||||
});
|
||||
|
||||
it('should not call BrowserWindow show event', async () => {
|
||||
const w = new BrowserWindow({ show: false });
|
||||
const shown = once(w, 'show');
|
||||
w.show();
|
||||
await shown;
|
||||
|
||||
let showCalled = false;
|
||||
w.on('show', () => {
|
||||
showCalled = true;
|
||||
});
|
||||
|
||||
w.previewFile(__filename);
|
||||
await setTimeout(500);
|
||||
expect(showCalled).to.equal(false, 'should not have called show twice');
|
||||
});
|
||||
});
|
||||
|
||||
// TODO (jkleinsc) renable these tests on mas arm64
|
||||
|
|
Loading…
Reference in a new issue