Commit 5f06bf80 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Implement SysCommand() to prevent Alt keypresses from activating system menu.

parent 9f6f8bfc
......@@ -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,
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment