explorer: Use a different return value to indicate that the x11 system tray is not available, so that x11drv can return errors too.

This commit is contained in:
Alexandre Julliard 2008-05-13 20:56:25 +02:00
parent e568580447
commit 26e566b91f
2 changed files with 9 additions and 6 deletions

View File

@ -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 );

View File

@ -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)