BWindow: Only try to install new menu shortcuts if B_COMMAND_KEY is down.
This is too expensive to do on every key press, and became a problem when #7078 was fixed in hrev58589. Fixes #19580. Change-Id: Iff2d2c208fa976f1f5db6a369820d8210f2e4c4e Reviewed-on: https://review.haiku-os.org/c/haiku/+/10706 Reviewed-by: waddlesplash <[email protected]> Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
bc415d41f1
commit
78afa49561
@@ -3745,6 +3745,9 @@ BWindow::_HandleKeyDown(BMessage* event)
|
|||||||
// chance to update its menus. This may install new shortcuts,
|
// chance to update its menus. This may install new shortcuts,
|
||||||
// which is why we have to call it here, before trying to find
|
// which is why we have to call it here, before trying to find
|
||||||
// a shortcut for the given key.
|
// a shortcut for the given key.
|
||||||
|
// Only do this if Command key is down, it's too expensive to
|
||||||
|
// do this on every key press.
|
||||||
|
if ((modifiers & B_COMMAND_KEY) != 0)
|
||||||
MenusBeginning();
|
MenusBeginning();
|
||||||
|
|
||||||
Shortcut* shortcut = _FindShortcut(key, modifiers
|
Shortcut* shortcut = _FindShortcut(key, modifiers
|
||||||
@@ -3781,6 +3784,7 @@ BWindow::_HandleKeyDown(BMessage* event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((modifiers & B_COMMAND_KEY) != 0)
|
||||||
MenusEnded();
|
MenusEnded();
|
||||||
|
|
||||||
if (shortcut != NULL)
|
if (shortcut != NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user