fix: add missing set_wants_to_be_visible(true)
to NativeWindowMac::ShowInactive()
(#40546)
* fix: add missing set_wants_to_be_visible(true) to NativeWindowMac::ShowInactive() * add test
This commit is contained in:
parent
b2fcc15ec7
commit
39ee94089a
2 changed files with 30 additions and 0 deletions
|
@ -534,6 +534,8 @@ void NativeWindowMac::Show() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindowMac::ShowInactive() {
|
void NativeWindowMac::ShowInactive() {
|
||||||
|
set_wants_to_be_visible(true);
|
||||||
|
|
||||||
// Reattach the window to the parent to actually show it.
|
// Reattach the window to the parent to actually show it.
|
||||||
if (parent())
|
if (parent())
|
||||||
InternalSetParentWindow(parent(), true);
|
InternalSetParentWindow(parent(), true);
|
||||||
|
|
|
@ -1144,6 +1144,34 @@ describe('BrowserWindow module', () => {
|
||||||
await shown;
|
await shown;
|
||||||
expect(w.isMaximized()).to.equal(true);
|
expect(w.isMaximized()).to.equal(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ifit(process.platform === 'darwin')('should attach child window to parent', async () => {
|
||||||
|
const wShow = once(w, 'show');
|
||||||
|
w.show();
|
||||||
|
await wShow;
|
||||||
|
|
||||||
|
const c = new BrowserWindow({ show: false, parent: w });
|
||||||
|
const cShow = once(c, 'show');
|
||||||
|
c.showInactive();
|
||||||
|
await cShow;
|
||||||
|
|
||||||
|
// verifying by checking that the child tracks the parent's visibility
|
||||||
|
const minimized = once(w, 'minimize');
|
||||||
|
w.minimize();
|
||||||
|
await minimized;
|
||||||
|
|
||||||
|
expect(w.isVisible()).to.be.false('parent is visible');
|
||||||
|
expect(c.isVisible()).to.be.false('child is visible');
|
||||||
|
|
||||||
|
const restored = once(w, 'restore');
|
||||||
|
w.restore();
|
||||||
|
await restored;
|
||||||
|
|
||||||
|
expect(w.isVisible()).to.be.true('parent is visible');
|
||||||
|
expect(c.isVisible()).to.be.true('child is visible');
|
||||||
|
|
||||||
|
closeWindow(c);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('BrowserWindow.focus()', () => {
|
describe('BrowserWindow.focus()', () => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue