[PATCH] winex11: Send SC_KEYMENU on managed windows.

Alex Henrie alexhenrie24 at gmail.com
Tue May 17 00:49:50 CDT 2016


Cc: Dmitry Timoshkov <dmitry at baikal.ru>

Fixes https://bugs.winehq.org/show_bug.cgi?id=21918

Dmitry Timoshkov opposed this patch because he thought that it would be
too confusing to display Wine's system menu instead of the window
manager's system menu. However, as far as I can tell, removing this
block of code does not make it any easier or harder to access Wine's
system menu. Simply tapping Alt does not open the system menu on Wine or
Windows, although Wine's system menu can be opened by tapping Alt, then
tapping Down (just like on Windows). Furthermore, as long as you use a
window manager such as fvwm that doesn't have an Alt+Space keybinding,
Alt+Space also already opens Wine's system menu.

You can see what I'm talking about by running `wine uninstaller` or any
other program that has a system menu but not an application menu.

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
 dlls/user32/tests/msg.c   |  5 ++---
 dlls/winex11.drv/window.c | 11 -----------
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index e39f8a1..3ddad6a 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -7997,8 +7997,7 @@ static void test_accelerators(void)
     keybd_event(VK_MENU, 0, 0, 0);
     keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0);
     pump_msg_loop(hwnd, 0);
-    /* this test doesn't pass in Wine for managed windows */
-    ok_sequence(WmAltPressRelease, "Alt press/release", TRUE);
+    ok_sequence(WmAltPressRelease, "Alt press/release", FALSE);
 
     trace("testing VK_F1 press/release\n");
     keybd_event(VK_F1, 0, 0, 0);
@@ -8018,7 +8017,7 @@ static void test_accelerators(void)
     keybd_event(VK_F10, 0, 0, 0);
     keybd_event(VK_F10, 0, KEYEVENTF_KEYUP, 0);
     pump_msg_loop(hwnd, 0);
-    ok_sequence(WmVkF10Seq, "VK_F10 press/release", TRUE);
+    ok_sequence(WmVkF10Seq, "VK_F10 press/release", FALSE);
 
     trace("testing SHIFT+F10 press/release\n");
     keybd_event(VK_SHIFT, 0, 0, 0);
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 4789f98..a70d74b 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -2740,17 +2740,6 @@ LRESULT CDECL X11DRV_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam )
         default:               dir = _NET_WM_MOVERESIZE_SIZE_KEYBOARD; break;
         }
         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) goto failed;  /* got an explicit char */
-        if (GetMenu( hwnd )) goto failed;  /* window has a real menu */
-        if (!(GetWindowLongW( hwnd, GWL_STYLE ) & WS_SYSMENU)) goto failed;  /* no system menu */
-        TRACE( "ignoring SC_KEYMENU wp %lx lp %lx\n", wparam, lparam );
-        release_win_data( data );
-        return 0;
-
     default:
         goto failed;
     }
-- 
2.8.2




More information about the wine-patches mailing list