mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-18 10:26:33 +00:00
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:
parent
e568580447
commit
26e566b91f
|
@ -415,7 +415,7 @@ static BOOL delete_icon( struct tray_icon *icon )
|
||||||
*
|
*
|
||||||
* Driver-side implementation of Shell_NotifyIcon.
|
* 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;
|
BOOL ret = FALSE;
|
||||||
struct tray_icon *icon;
|
struct tray_icon *icon;
|
||||||
|
@ -423,7 +423,9 @@ BOOL wine_notify_icon( DWORD msg, NOTIFYICONDATAW *data )
|
||||||
switch (msg)
|
switch (msg)
|
||||||
{
|
{
|
||||||
case NIM_ADD:
|
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;
|
break;
|
||||||
case NIM_DELETE:
|
case NIM_DELETE:
|
||||||
if ((icon = get_icon( data->hWnd, data->uID ))) ret = delete_icon( icon );
|
if ((icon = get_icon( data->hWnd, data->uID ))) ret = delete_icon( icon );
|
||||||
|
|
|
@ -35,7 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(systray);
|
||||||
#define IS_OPTION_FALSE(ch) \
|
#define IS_OPTION_FALSE(ch) \
|
||||||
((ch) == 'n' || (ch) == 'N' || (ch) == 'f' || (ch) == 'F' || (ch) == '0')
|
((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 */
|
/* an individual systray icon, unpacked from the NOTIFYICONDATA and always in unicode */
|
||||||
struct icon
|
struct icon
|
||||||
|
@ -348,7 +348,7 @@ static BOOL handle_incoming(HWND hwndSource, COPYDATASTRUCT *cds)
|
||||||
struct icon *icon = NULL;
|
struct icon *icon = NULL;
|
||||||
NOTIFYICONDATAW nid;
|
NOTIFYICONDATAW nid;
|
||||||
DWORD cbSize;
|
DWORD cbSize;
|
||||||
BOOL ret = FALSE;
|
int ret = FALSE;
|
||||||
|
|
||||||
if (cds->cbData < NOTIFYICONDATAW_V1_SIZE) return FALSE;
|
if (cds->cbData < NOTIFYICONDATAW_V1_SIZE) return FALSE;
|
||||||
cbSize = ((PNOTIFYICONDATA)cds->lpData)->cbSize;
|
cbSize = ((PNOTIFYICONDATA)cds->lpData)->cbSize;
|
||||||
|
@ -398,11 +398,12 @@ static BOOL handle_incoming(HWND hwndSource, COPYDATASTRUCT *cds)
|
||||||
/* try forward to x11drv first */
|
/* try forward to x11drv first */
|
||||||
if (cds->dwData == NIM_ADD || !(icon = get_icon( nid.hWnd, nid.uID )))
|
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 );
|
if (nid.uFlags & NIF_ICON) DestroyIcon( nid.hIcon );
|
||||||
return TRUE;
|
return ret;
|
||||||
}
|
}
|
||||||
|
ret = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (cds->dwData)
|
switch (cds->dwData)
|
||||||
|
|
Loading…
Reference in a new issue