diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c index 2efc415bb45..7a14d876fdd 100644 --- a/dlls/user32/menu.c +++ b/dlls/user32/menu.c @@ -3365,13 +3365,7 @@ void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, WCHAR wChar) MENU_SelectItem( hwnd, hTrackMenu, uItem, TRUE, 0 ); - if (wParam & HTSYSMENU && wChar != ' ') - { - /* prevent sysmenu activation for managed windows on Alt down/up */ - if (GetPropA( hwnd, "__wine_x11_managed" )) - wFlags |= TF_ENDMENU; /* schedule end of menu tracking */ - } - else + if (!(wParam & HTSYSMENU) || wChar == ' ') { if( uItem == NO_SELECTED_ITEM ) MENU_MoveSelection( hwnd, hTrackMenu, ITEM_NEXT ); diff --git a/dlls/winex11.drv/winpos.c b/dlls/winex11.drv/winpos.c index f5b27f09de9..b12ded1e8b2 100644 --- a/dlls/winex11.drv/winpos.c +++ b/dlls/winex11.drv/winpos.c @@ -752,6 +752,15 @@ LRESULT X11DRV_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam ) } break; + case SC_KEYMENU: + /* prevent a simple ALT press+release from activating the system menu, + * as that can get confusing on managed windows */ + if ((WCHAR)lparam) return -1; /* got an explicit char */ + if (GetMenu( hwnd )) return -1; /* window has a real menu */ + if (!(GetWindowLongW( hwnd, GWL_STYLE ) & WS_SYSMENU)) return -1; /* no system menu */ + TRACE( "ignoring SC_KEYMENU wp %lx lp %lx\n", wparam, lparam ); + return 0; + default: return -1; }