user32: Moved the menu activation hack on managed windows to the X11 driver.

This commit is contained in:
Alexandre Julliard 2008-04-10 16:41:26 +02:00
parent fa677c7f72
commit eb857aebeb
2 changed files with 10 additions and 7 deletions

View File

@ -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 );

View File

@ -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;
}