diff --git a/dlls/winex11.drv/systray.c b/dlls/winex11.drv/systray.c index d2a07fc33f1..dffacf56012 100644 --- a/dlls/winex11.drv/systray.c +++ b/dlls/winex11.drv/systray.c @@ -415,7 +415,7 @@ static BOOL delete_icon( struct tray_icon *icon ) * * Driver-side implementation of Shell_NotifyIcon. */ -BOOL wine_notify_icon( DWORD msg, NOTIFYICONDATAW *data ) +int wine_notify_icon( DWORD msg, NOTIFYICONDATAW *data ) { BOOL ret = FALSE; struct tray_icon *icon; @@ -423,7 +423,9 @@ BOOL wine_notify_icon( DWORD msg, NOTIFYICONDATAW *data ) switch (msg) { case NIM_ADD: - if (get_systray_selection_owner( thread_display() )) ret = add_icon( data ); + if (!get_systray_selection_owner( thread_display() )) + return -1; /* fall back to default handling */ + ret = add_icon( data ); break; case NIM_DELETE: if ((icon = get_icon( data->hWnd, data->uID ))) ret = delete_icon( icon ); diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index b259b814ca6..8b82d9a5a40 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -35,7 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(systray); #define IS_OPTION_FALSE(ch) \ ((ch) == 'n' || (ch) == 'N' || (ch) == 'f' || (ch) == 'F' || (ch) == '0') -static BOOL (*wine_notify_icon)(DWORD,NOTIFYICONDATAW *); +static int (*wine_notify_icon)(DWORD,NOTIFYICONDATAW *); /* an individual systray icon, unpacked from the NOTIFYICONDATA and always in unicode */ struct icon @@ -348,7 +348,7 @@ static BOOL handle_incoming(HWND hwndSource, COPYDATASTRUCT *cds) struct icon *icon = NULL; NOTIFYICONDATAW nid; DWORD cbSize; - BOOL ret = FALSE; + int ret = FALSE; if (cds->cbData < NOTIFYICONDATAW_V1_SIZE) return FALSE; cbSize = ((PNOTIFYICONDATA)cds->lpData)->cbSize; @@ -398,11 +398,12 @@ static BOOL handle_incoming(HWND hwndSource, COPYDATASTRUCT *cds) /* try forward to x11drv first */ if (cds->dwData == NIM_ADD || !(icon = get_icon( nid.hWnd, nid.uID ))) { - if (wine_notify_icon && wine_notify_icon( cds->dwData, &nid )) + if (wine_notify_icon && ((ret = wine_notify_icon( cds->dwData, &nid )) != -1)) { if (nid.uFlags & NIF_ICON) DestroyIcon( nid.hIcon ); - return TRUE; + return ret; } + ret = FALSE; } switch (cds->dwData)