mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-31 13:39:58 +01:00
Don't show Quit warning on keyUp residual event
The warning triggered whenever the app got focus after another window was closed with a Ctrl+Q shortcut and the keys were then released. Hitting the 'Close Element' button didn't even close the app in this case, as only the warning handler was triggered, not the actual quit shortcut (which does discriminate between key press and key release). Actually checking for 'keyDown' should prevent this from occurring again. Fixes vector-im/element-web#17714 Signed-off-by: Antoine Martin <antoine@alarsyo.net>
This commit is contained in:
parent
7b6ead738e
commit
10a11242ff
@ -264,7 +264,8 @@ const exitShortcuts = [
|
|||||||
|
|
||||||
const warnBeforeExit = (event, input) => {
|
const warnBeforeExit = (event, input) => {
|
||||||
const shouldWarnBeforeExit = store.get('warnBeforeExit', true);
|
const shouldWarnBeforeExit = store.get('warnBeforeExit', true);
|
||||||
const exitShortcutPressed = exitShortcuts.some(shortcutFn => shortcutFn(input, process.platform));
|
const exitShortcutPressed =
|
||||||
|
input.type === 'keyDown' && exitShortcuts.some(shortcutFn => shortcutFn(input, process.platform));
|
||||||
|
|
||||||
if (shouldWarnBeforeExit && exitShortcutPressed) {
|
if (shouldWarnBeforeExit && exitShortcutPressed) {
|
||||||
const shouldCancelCloseRequest = dialog.showMessageBoxSync(mainWindow, {
|
const shouldCancelCloseRequest = dialog.showMessageBoxSync(mainWindow, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user