Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
aceec41e
Commit
aceec41e
authored
Mar 27, 2015
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
explorer: Cleanup system tray icons when their owner is destroyed instead of polling.
parent
7c538cdd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
15 deletions
+21
-15
desktop.c
programs/explorer/desktop.c
+4
-0
explorer_private.h
programs/explorer/explorer_private.h
+6
-5
systray.c
programs/explorer/systray.c
+11
-10
No files found.
programs/explorer/desktop.c
View file @
aceec41e
...
...
@@ -529,6 +529,10 @@ static LRESULT WINAPI desktop_wnd_proc( HWND hwnd, UINT message, WPARAM wp, LPAR
SystemParametersInfoW
(
SPI_SETDESKWALLPAPER
,
0
,
NULL
,
FALSE
);
return
0
;
case
WM_PARENTNOTIFY
:
if
(
LOWORD
(
wp
)
==
WM_DESTROY
)
cleanup_systray_window
(
(
HWND
)
lp
);
return
0
;
case
WM_LBUTTONDBLCLK
:
if
(
!
using_root
)
{
...
...
programs/explorer/explorer_private.h
View file @
aceec41e
...
...
@@ -21,10 +21,11 @@
#ifndef __WINE_EXPLORER_PRIVATE_H
#define __WINE_EXPLORER_PRIVATE_H
extern
void
manage_desktop
(
WCHAR
*
arg
);
extern
void
initialize_systray
(
HMODULE
graphics_driver
,
BOOL
using_root
,
BOOL
enable_shell
);
extern
void
initialize_appbar
(
void
);
extern
void
do_startmenu
(
HWND
owner
);
extern
LRESULT
menu_wndproc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
);
extern
void
manage_desktop
(
WCHAR
*
arg
)
DECLSPEC_HIDDEN
;
extern
void
initialize_systray
(
HMODULE
graphics_driver
,
BOOL
using_root
,
BOOL
enable_shell
)
DECLSPEC_HIDDEN
;
extern
void
initialize_appbar
(
void
)
DECLSPEC_HIDDEN
;
extern
void
cleanup_systray_window
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
void
do_startmenu
(
HWND
owner
)
DECLSPEC_HIDDEN
;
extern
LRESULT
menu_wndproc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
DECLSPEC_HIDDEN
;
#endif
/* __WINE_EXPLORER_PRIVATE_H */
programs/explorer/systray.c
View file @
aceec41e
...
...
@@ -97,11 +97,9 @@ static HWND start_button;
#define MIN_DISPLAYED 8
#define ICON_BORDER 2
#define VALID_WIN_TIMER 1
#define BALLOON_CREATE_TIMER 2
#define BALLOON_SHOW_TIMER 3
#define BALLOON_CREATE_TIMER 1
#define BALLOON_SHOW_TIMER 2
#define VALID_WIN_TIMEOUT 2000
#define BALLOON_CREATE_TIMEOUT 2000
#define BALLOON_SHOW_MIN_TIMEOUT 10000
#define BALLOON_SHOW_MAX_TIMEOUT 30000
...
...
@@ -430,7 +428,6 @@ static BOOL add_icon(NOTIFYICONDATAW *nid)
icon
->
owner
=
nid
->
hWnd
;
icon
->
display
=
-
1
;
if
(
list_empty
(
&
icon_list
))
SetTimer
(
tray_window
,
VALID_WIN_TIMER
,
VALID_WIN_TIMEOUT
,
NULL
);
list_add_tail
(
&
icon_list
,
&
icon
->
entry
);
return
modify_icon
(
icon
,
nid
);
...
...
@@ -443,17 +440,22 @@ static BOOL delete_icon(struct icon *icon)
list_remove
(
&
icon
->
entry
);
DestroyIcon
(
icon
->
image
);
HeapFree
(
GetProcessHeap
(),
0
,
icon
);
if
(
list_empty
(
&
icon_list
))
KillTimer
(
tray_window
,
VALID_WIN_TIMER
);
return
TRUE
;
}
/* cleanup icons belonging to
windows that have
been destroyed */
static
void
cleanup_destroyed_windows
(
void
)
/* cleanup icons belonging to
a window that has
been destroyed */
void
cleanup_systray_window
(
HWND
hwnd
)
{
struct
icon
*
icon
,
*
next
;
LIST_FOR_EACH_ENTRY_SAFE
(
icon
,
next
,
&
icon_list
,
struct
icon
,
entry
)
if
(
!
IsWindow
(
icon
->
owner
))
delete_icon
(
icon
);
if
(
icon
->
owner
==
hwnd
)
delete_icon
(
icon
);
if
(
wine_notify_icon
)
{
NOTIFYICONDATAW
nid
=
{
sizeof
(
nid
),
hwnd
};
wine_notify_icon
(
0xdead
,
&
nid
);
}
}
static
BOOL
handle_incoming
(
HWND
hwndSource
,
COPYDATASTRUCT
*
cds
)
...
...
@@ -561,7 +563,6 @@ static LRESULT WINAPI tray_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
case
WM_TIMER
:
switch
(
wparam
)
{
case
VALID_WIN_TIMER
:
cleanup_destroyed_windows
();
break
;
case
BALLOON_CREATE_TIMER
:
balloon_create_timer
();
break
;
case
BALLOON_SHOW_TIMER
:
balloon_timer
();
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment