Ken Thomases : winemac: Implement SysCommand() to prevent Alt keypresses from activating system menu.
Alexandre Julliard
julliard at winehq.org
Thu Feb 7 14:07:23 CST 2013
Module: wine
Branch: master
Commit: 5f06bf80db714c1c355018cf7e3bd0e5eaa73ebe
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5f06bf80db714c1c355018cf7e3bd0e5eaa73ebe
Author: Ken Thomases <ken at codeweavers.com>
Date: Wed Feb 6 19:32:18 2013 -0600
winemac: Implement SysCommand() to prevent Alt keypresses from activating system menu.
---
dlls/winemac.drv/window.c | 30 ++++++++++++++++++++++++++++++
dlls/winemac.drv/winemac.drv.spec | 1 +
2 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c
index 9d63912..7a7eda7 100644
--- a/dlls/winemac.drv/window.c
+++ b/dlls/winemac.drv/window.c
@@ -1041,6 +1041,36 @@ done:
/***********************************************************************
+ * SysCommand (MACDRV.@)
+ *
+ * Perform WM_SYSCOMMAND handling.
+ */
+LRESULT CDECL macdrv_SysCommand(HWND hwnd, WPARAM wparam, LPARAM lparam)
+{
+ struct macdrv_win_data *data;
+ LRESULT ret = -1;
+
+ TRACE("%p, %x, %lx\n", hwnd, (unsigned)wparam, lparam);
+
+ if (!(data = get_win_data(hwnd))) goto done;
+ if (!data->cocoa_window || !data->on_screen) goto done;
+
+ /* prevent a simple ALT press+release from activating the system menu,
+ as that can get confusing */
+ if ((wparam & 0xfff0) == SC_KEYMENU && !(WCHAR)lparam && !GetMenu(hwnd) &&
+ (GetWindowLongW(hwnd, GWL_STYLE) & WS_SYSMENU))
+ {
+ TRACE("ignoring SC_KEYMENU wp %lx lp %lx\n", wparam, lparam);
+ ret = 0;
+ }
+
+done:
+ release_win_data(data);
+ return ret;
+}
+
+
+/***********************************************************************
* UpdateLayeredWindow (MACDRV.@)
*/
BOOL CDECL macdrv_UpdateLayeredWindow(HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
diff --git a/dlls/winemac.drv/winemac.drv.spec b/dlls/winemac.drv/winemac.drv.spec
index 30df9d6..57b1e5a 100644
--- a/dlls/winemac.drv/winemac.drv.spec
+++ b/dlls/winemac.drv/winemac.drv.spec
@@ -24,6 +24,7 @@
@ cdecl SetWindowStyle(ptr long ptr) macdrv_SetWindowStyle
@ cdecl SetWindowText(long wstr) macdrv_SetWindowText
@ cdecl ShowWindow(long long ptr long) macdrv_ShowWindow
+@ cdecl SysCommand(long long long) macdrv_SysCommand
@ cdecl ToUnicodeEx(long long ptr ptr long long long) macdrv_ToUnicodeEx
@ cdecl UpdateLayeredWindow(long ptr ptr) macdrv_UpdateLayeredWindow
@ cdecl VkKeyScanEx(long long) macdrv_VkKeyScanEx
More information about the wine-cvs
mailing list