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

Alexandre Julliard julliard at winehq.org
Fri Apr 11 06:27:36 CDT 2008


Module: wine
Branch: master
Commit: eb857aebebb138d9fc3e711b9f2943fab5c1ef79
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=eb857aebebb138d9fc3e711b9f2943fab5c1ef79

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Apr 10 16:41:26 2008 +0200

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

---

 dlls/user32/menu.c        |    8 +-------
 dlls/winex11.drv/winpos.c |    9 +++++++++
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c
index 2efc415..7a14d87 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 f5b27f0..b12ded1 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;
     }




More information about the wine-cvs mailing list