This is an attempt to fix issue #2409.
If canvas has focus, we should handle possible keyboard shortcuts before docked dialogs eat them. This is very simple, targeted change.
Note that some Alt+key combinations may still be in conflict when both dialogs and main menu use them. In this case it seems it's semi-random who gets to handle them. This is however existing behavior, unrelated to this change.
Please give it a try on different platforms.