Module: wine Branch: master Commit: 550cac96865ecd6f7a98d70ad88bf7f6d0ce2560 URL: https://gitlab.winehq.org/wine/wine/-/commit/550cac96865ecd6f7a98d70ad88bf7f...
Author: Rémi Bernon rbernon@codeweavers.com Date: Mon Nov 27 09:51:15 2023 +0100
winemac: Use the new NotifyIcon user driver interface.
---
dlls/winemac.drv/dllmain.c | 6 ----- dlls/winemac.drv/gdi.c | 2 ++ dlls/winemac.drv/macdrv.h | 3 ++- dlls/winemac.drv/macdrv_main.c | 57 --------------------------------------- dlls/winemac.drv/systray.c | 24 ++++++----------- dlls/winemac.drv/unixlib.h | 8 ------ dlls/winemac.drv/winemac.drv.spec | 2 -- 7 files changed, 12 insertions(+), 90 deletions(-)
diff --git a/dlls/winemac.drv/dllmain.c b/dlls/winemac.drv/dllmain.c index 8812426cc44..5917ed0906f 100644 --- a/dlls/winemac.drv/dllmain.c +++ b/dlls/winemac.drv/dllmain.c @@ -424,9 +424,3 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) macdrv_module = instance; return process_attach(); } - -int CDECL wine_notify_icon(DWORD msg, NOTIFYICONDATAW *data) -{ - struct notify_icon_params params = { .msg = msg, .data = data }; - return MACDRV_CALL(notify_icon, ¶ms); -} diff --git a/dlls/winemac.drv/gdi.c b/dlls/winemac.drv/gdi.c index 60ee9339467..6c2241514a9 100644 --- a/dlls/winemac.drv/gdi.c +++ b/dlls/winemac.drv/gdi.c @@ -269,6 +269,8 @@ static const struct user_driver_funcs macdrv_funcs = .pBeep = macdrv_Beep, .pChangeDisplaySettings = macdrv_ChangeDisplaySettings, .pClipCursor = macdrv_ClipCursor, + .pNotifyIcon = macdrv_NotifyIcon, + .pCleanupIcons = macdrv_CleanupIcons, .pClipboardWindowProc = macdrv_ClipboardWindowProc, .pDesktopWindowProc = macdrv_DesktopWindowProc, .pDestroyCursorIcon = macdrv_DestroyCursorIcon, diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index a1cdcc76ebc..e1dd1c61b3f 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -134,6 +134,8 @@ extern BOOL macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device extern BOOL macdrv_GetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp); extern BOOL macdrv_SetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp); extern BOOL macdrv_ClipCursor(const RECT *clip, BOOL reset); +extern LRESULT macdrv_NotifyIcon(HWND hwnd, UINT msg, NOTIFYICONDATAW *data); +extern void macdrv_CleanupIcons(HWND hwnd); extern LRESULT macdrv_DesktopWindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); extern void macdrv_DestroyWindow(HWND hwnd); extern void macdrv_SetDesktopWindow(HWND hwnd); @@ -281,7 +283,6 @@ extern NTSTATUS macdrv_dnd_get_formats(void *arg); extern NTSTATUS macdrv_dnd_have_format(void *arg); extern NTSTATUS macdrv_dnd_release(void *arg); extern NTSTATUS macdrv_dnd_retain(void *arg); -extern NTSTATUS macdrv_notify_icon(void *arg);
extern NTSTATUS macdrv_client_func(enum macdrv_client_funcs func, const void *params, ULONG size); diff --git a/dlls/winemac.drv/macdrv_main.c b/dlls/winemac.drv/macdrv_main.c index b40bf02f267..21b148ff558 100644 --- a/dlls/winemac.drv/macdrv_main.c +++ b/dlls/winemac.drv/macdrv_main.c @@ -623,7 +623,6 @@ const unixlib_entry_t __wine_unix_call_funcs[] = macdrv_dnd_release, macdrv_dnd_retain, macdrv_init, - macdrv_notify_icon, macdrv_quit_result, };
@@ -661,61 +660,6 @@ static NTSTATUS wow64_init(void *arg) return macdrv_init(¶ms); }
-static NTSTATUS wow64_notify_icon(void *arg) -{ - struct - { - DWORD msg; - ULONG data; - } *params32 = arg; - struct - { - DWORD cbSize; - ULONG hWnd; - UINT uID; - UINT uFlags; - UINT uCallbackMessage; - ULONG hIcon; - WCHAR szTip[128]; - DWORD dwState; - DWORD dwStateMask; - WCHAR szInfo[256]; - UINT uTimeout; - WCHAR szInfoTitle[64]; - DWORD dwInfoFlags; - GUID guidItem; - ULONG hBalloonIcon; - } *data32 = UlongToPtr(params32->data); - - struct notify_icon_params params; - NOTIFYICONDATAW data; - - params.msg = params32->msg; - params.data = &data; - - data.cbSize = sizeof(data); - data.hWnd = UlongToHandle(data32->hWnd); - data.uID = data32->uID; - data.uFlags = data32->uFlags; - data.uCallbackMessage = data32->uCallbackMessage; - data.hIcon = UlongToHandle(data32->hIcon); - if (data.uFlags & NIF_TIP) - wcscpy(data.szTip, data32->szTip); - data.dwState = data32->dwState; - data.dwStateMask = data32->dwStateMask; - if (data.uFlags & NIF_INFO) - { - wcscpy(data.szInfoTitle, data32->szInfoTitle); - wcscpy(data.szInfo, data32->szInfo); - data.uTimeout = data32->uTimeout; - data.dwInfoFlags = data32->dwInfoFlags; - } - data.guidItem = data32->guidItem; - data.hBalloonIcon = UlongToHandle(data32->hBalloonIcon); - - return macdrv_notify_icon(¶ms); -} - const unixlib_entry_t __wine_unix_call_wow64_funcs[] = { wow64_dnd_get_data, @@ -724,7 +668,6 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = macdrv_dnd_release, macdrv_dnd_retain, wow64_init, - wow64_notify_icon, macdrv_quit_result, };
diff --git a/dlls/winemac.drv/systray.c b/dlls/winemac.drv/systray.c index 42ffe49f563..0231e08e82b 100644 --- a/dlls/winemac.drv/systray.c +++ b/dlls/winemac.drv/systray.c @@ -59,12 +59,11 @@ static struct list icon_list = LIST_INIT(icon_list); static BOOL delete_icon(struct tray_icon *icon);
+ /*********************************************************************** - * cleanup_icons - * - * Delete all systray icons owned by a given window. + * CleanupIcons (MACDRV.@) */ -static void cleanup_icons(HWND hwnd) +void macdrv_CleanupIcons(HWND hwnd) { struct tray_icon *icon, *next;
@@ -245,18 +244,14 @@ static BOOL delete_icon(struct tray_icon *icon)
/*********************************************************************** - * wine_notify_icon (MACDRV.@) - * - * Driver-side implementation of Shell_NotifyIcon. + * NotifyIcon (MACDRV.@) */ -NTSTATUS macdrv_notify_icon(void *arg) +LRESULT macdrv_NotifyIcon(HWND hwnd, UINT msg, NOTIFYICONDATAW *data) { - struct notify_icon_params *params = arg; - NOTIFYICONDATAW *data = params->data; BOOL ret = FALSE; struct tray_icon *icon;
- switch (params->msg) + switch (msg) { case NIM_ADD: ret = add_icon(data); @@ -267,9 +262,6 @@ NTSTATUS macdrv_notify_icon(void *arg) case NIM_MODIFY: if ((icon = get_icon(data->hWnd, data->uID))) ret = modify_icon(icon, data); break; - case 0xdead: /* Wine extension: owner window has died */ - cleanup_icons(data->hWnd); - break; case NIM_SETVERSION: if ((icon = get_icon(data->hWnd, data->uID))) { @@ -278,8 +270,8 @@ NTSTATUS macdrv_notify_icon(void *arg) } break; default: - FIXME("unhandled tray message: %u\n", params->msg); - break; + ERR("Unexpected NotifyIconProc call\n"); + return -1; } return ret; } diff --git a/dlls/winemac.drv/unixlib.h b/dlls/winemac.drv/unixlib.h index 7f14517a8ee..e77a31a86c1 100644 --- a/dlls/winemac.drv/unixlib.h +++ b/dlls/winemac.drv/unixlib.h @@ -27,7 +27,6 @@ enum macdrv_funcs unix_dnd_release, unix_dnd_retain, unix_init, - unix_notify_icon, unix_quit_result, unix_funcs_count }; @@ -70,13 +69,6 @@ struct init_params struct localized_string *strings; };
-/* macdrv_notify_icon params */ -struct notify_icon_params -{ - unsigned int msg; - struct _NOTIFYICONDATAW *data; -}; - /* macdrv_quit_result params */ struct quit_result_params { diff --git a/dlls/winemac.drv/winemac.drv.spec b/dlls/winemac.drv/winemac.drv.spec index 5f086f5c4e5..e69de29bb2d 100644 --- a/dlls/winemac.drv/winemac.drv.spec +++ b/dlls/winemac.drv/winemac.drv.spec @@ -1,2 +0,0 @@ -# System tray -@ cdecl wine_notify_icon(long ptr)