Pressing ALT or F10 on Windows no longer steals the focus

This commit is contained in:
Laurent Gomila 2013-06-18 14:32:08 +02:00
parent 7554c86f7d
commit 96d0204f30

View File

@ -899,6 +899,10 @@ LRESULT CALLBACK WindowImplWin32::globalOnEvent(HWND handle, UINT message, WPARA
if (message == WM_CLOSE)
return 0;
// Don't forward the menu system command, so that pressing ALT or F10 doesn't steal the focus
if ((message == WM_SYSCOMMAND) && (wParam == SC_KEYMENU))
return 0;
static const bool hasUnicode = hasUnicodeSupport();
return hasUnicode ? DefWindowProcW(handle, message, wParam, lParam) :
DefWindowProcA(handle, message, wParam, lParam);