fix: updated Alt detection to explicitly exclude AltGraph/AltGr (#49778)

Updated Alt detection to explicitly exclude AltGraph/AltGr
This commit is contained in:
Shashwat Raj
2026-02-23 11:00:27 -07:00
committed by GitHub
parent 9d0a0a5459
commit 90c9de70ac
2 changed files with 33 additions and 3 deletions

View File

@@ -5925,6 +5925,23 @@ describe('BrowserWindow module', () => {
});
});
ifdescribe(process.platform === 'linux')('menu bar AltGr behavior', () => {
it('does not toggle auto-hide menu bar visibility', async () => {
const w = new BrowserWindow({ show: false, autoHideMenuBar: true });
w.setMenuBarVisibility(false);
expect(w.isMenuBarVisible()).to.be.false('isMenuBarVisible');
w.show();
await once(w, 'show');
w.webContents.focus();
w.webContents.sendInputEvent({ type: 'keyDown', keyCode: 'AltGr' });
w.webContents.sendInputEvent({ type: 'keyUp', keyCode: 'AltGr' });
await setTimeout();
expect(w.isMenuBarVisible()).to.be.false('isMenuBarVisible');
});
});
ifdescribe(process.platform !== 'darwin')('when fullscreen state is changed', () => {
it('correctly remembers state prior to fullscreen change', async () => {
const w = new BrowserWindow({ show: false });