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
62c6646d
Commit
62c6646d
authored
Jun 23, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Dec 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Introduce new SystrayDock driver entry points.
parent
550cac96
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
3 deletions
+86
-3
driver.c
dlls/win32u/driver.c
+46
-0
systray.c
dlls/win32u/systray.c
+12
-0
ntuser.h
include/ntuser.h
+4
-0
gdi_driver.h
include/wine/gdi_driver.h
+4
-0
systray.c
programs/explorer/systray.c
+20
-3
No files found.
dlls/win32u/driver.c
View file @
62c6646d
...
@@ -775,6 +775,24 @@ static void nulldrv_CleanupIcons( HWND hwnd )
...
@@ -775,6 +775,24 @@ static void nulldrv_CleanupIcons( HWND hwnd )
{
{
}
}
static
void
nulldrv_SystrayDockInit
(
HWND
hwnd
)
{
}
static
BOOL
nulldrv_SystrayDockInsert
(
HWND
hwnd
,
UINT
cx
,
UINT
cy
,
void
*
icon
)
{
return
FALSE
;
}
static
void
nulldrv_SystrayDockClear
(
HWND
hwnd
)
{
}
static
BOOL
nulldrv_SystrayDockRemove
(
HWND
hwnd
)
{
return
FALSE
;
}
static
void
nulldrv_UpdateClipboard
(
void
)
static
void
nulldrv_UpdateClipboard
(
void
)
{
{
}
}
...
@@ -1176,6 +1194,26 @@ static void loaderdrv_CleanupIcons( HWND hwnd )
...
@@ -1176,6 +1194,26 @@ static void loaderdrv_CleanupIcons( HWND hwnd )
load_driver
()
->
pCleanupIcons
(
hwnd
);
load_driver
()
->
pCleanupIcons
(
hwnd
);
}
}
static
void
loaderdrv_SystrayDockInit
(
HWND
hwnd
)
{
load_driver
()
->
pSystrayDockInit
(
hwnd
);
}
static
BOOL
loaderdrv_SystrayDockInsert
(
HWND
hwnd
,
UINT
cx
,
UINT
cy
,
void
*
icon
)
{
return
load_driver
()
->
pSystrayDockInsert
(
hwnd
,
cx
,
cy
,
icon
);
}
static
void
loaderdrv_SystrayDockClear
(
HWND
hwnd
)
{
load_driver
()
->
pSystrayDockClear
(
hwnd
);
}
static
BOOL
loaderdrv_SystrayDockRemove
(
HWND
hwnd
)
{
return
load_driver
()
->
pSystrayDockRemove
(
hwnd
);
}
static
LRESULT
nulldrv_ClipboardWindowProc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
static
LRESULT
nulldrv_ClipboardWindowProc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
{
return
0
;
return
0
;
...
@@ -1265,6 +1303,10 @@ static const struct user_driver_funcs lazy_load_driver =
...
@@ -1265,6 +1303,10 @@ static const struct user_driver_funcs lazy_load_driver =
/* systray functions */
/* systray functions */
loaderdrv_NotifyIcon
,
loaderdrv_NotifyIcon
,
loaderdrv_CleanupIcons
,
loaderdrv_CleanupIcons
,
loaderdrv_SystrayDockInit
,
loaderdrv_SystrayDockInsert
,
loaderdrv_SystrayDockClear
,
loaderdrv_SystrayDockRemove
,
/* clipboard functions */
/* clipboard functions */
nulldrv_ClipboardWindowProc
,
nulldrv_ClipboardWindowProc
,
loaderdrv_UpdateClipboard
,
loaderdrv_UpdateClipboard
,
...
@@ -1351,6 +1393,10 @@ void __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version
...
@@ -1351,6 +1393,10 @@ void __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version
SET_USER_FUNC
(
ClipCursor
);
SET_USER_FUNC
(
ClipCursor
);
SET_USER_FUNC
(
NotifyIcon
);
SET_USER_FUNC
(
NotifyIcon
);
SET_USER_FUNC
(
CleanupIcons
);
SET_USER_FUNC
(
CleanupIcons
);
SET_USER_FUNC
(
SystrayDockInit
);
SET_USER_FUNC
(
SystrayDockInsert
);
SET_USER_FUNC
(
SystrayDockClear
);
SET_USER_FUNC
(
SystrayDockRemove
);
SET_USER_FUNC
(
ClipboardWindowProc
);
SET_USER_FUNC
(
ClipboardWindowProc
);
SET_USER_FUNC
(
UpdateClipboard
);
SET_USER_FUNC
(
UpdateClipboard
);
SET_USER_FUNC
(
ChangeDisplaySettings
);
SET_USER_FUNC
(
ChangeDisplaySettings
);
...
...
dlls/win32u/systray.c
View file @
62c6646d
...
@@ -40,6 +40,18 @@ LRESULT system_tray_call( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, voi
...
@@ -40,6 +40,18 @@ LRESULT system_tray_call( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, voi
case
WINE_SYSTRAY_CLEANUP_ICONS
:
case
WINE_SYSTRAY_CLEANUP_ICONS
:
user_driver
->
pCleanupIcons
(
hwnd
);
user_driver
->
pCleanupIcons
(
hwnd
);
return
0
;
return
0
;
case
WINE_SYSTRAY_DOCK_INIT
:
user_driver
->
pSystrayDockInit
(
hwnd
);
return
0
;
case
WINE_SYSTRAY_DOCK_INSERT
:
return
user_driver
->
pSystrayDockInsert
(
hwnd
,
wparam
,
lparam
,
data
);
case
WINE_SYSTRAY_DOCK_CLEAR
:
user_driver
->
pSystrayDockClear
(
hwnd
);
return
0
;
case
WINE_SYSTRAY_DOCK_REMOVE
:
return
user_driver
->
pSystrayDockRemove
(
hwnd
);
default:
default:
FIXME
(
"Unknown NtUserSystemTrayCall msg %#x
\n
"
,
msg
);
FIXME
(
"Unknown NtUserSystemTrayCall msg %#x
\n
"
,
msg
);
break
;
break
;
...
...
include/ntuser.h
View file @
62c6646d
...
@@ -526,6 +526,10 @@ enum wine_systray_call
...
@@ -526,6 +526,10 @@ enum wine_systray_call
{
{
WINE_SYSTRAY_NOTIFY_ICON
,
WINE_SYSTRAY_NOTIFY_ICON
,
WINE_SYSTRAY_CLEANUP_ICONS
,
WINE_SYSTRAY_CLEANUP_ICONS
,
WINE_SYSTRAY_DOCK_INIT
,
WINE_SYSTRAY_DOCK_INSERT
,
WINE_SYSTRAY_DOCK_CLEAR
,
WINE_SYSTRAY_DOCK_REMOVE
,
};
};
#define WM_SYSTIMER 0x0118
#define WM_SYSTIMER 0x0118
...
...
include/wine/gdi_driver.h
View file @
62c6646d
...
@@ -309,6 +309,10 @@ struct user_driver_funcs
...
@@ -309,6 +309,10 @@ struct user_driver_funcs
/* notify icon functions */
/* notify icon functions */
LRESULT
(
*
pNotifyIcon
)(
HWND
,
UINT
,
NOTIFYICONDATAW
*
);
LRESULT
(
*
pNotifyIcon
)(
HWND
,
UINT
,
NOTIFYICONDATAW
*
);
void
(
*
pCleanupIcons
)(
HWND
);
void
(
*
pCleanupIcons
)(
HWND
);
void
(
*
pSystrayDockInit
)(
HWND
);
BOOL
(
*
pSystrayDockInsert
)(
HWND
,
UINT
,
UINT
,
void
*
);
void
(
*
pSystrayDockClear
)(
HWND
);
BOOL
(
*
pSystrayDockRemove
)(
HWND
);
/* clipboard functions */
/* clipboard functions */
LRESULT
(
*
pClipboardWindowProc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
LRESULT
(
*
pClipboardWindowProc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
void
(
*
pUpdateClipboard
)(
void
);
void
(
*
pUpdateClipboard
)(
void
);
...
...
programs/explorer/systray.c
View file @
62c6646d
...
@@ -60,6 +60,7 @@ struct notify_data /* platform-independent format for NOTIFYICONDATA */
...
@@ -60,6 +60,7 @@ struct notify_data /* platform-independent format for NOTIFYICONDATA */
static
int
(
CDECL
*
wine_notify_icon
)(
DWORD
,
NOTIFYICONDATAW
*
);
static
int
(
CDECL
*
wine_notify_icon
)(
DWORD
,
NOTIFYICONDATAW
*
);
#define ICON_DISPLAY_HIDDEN -1
#define ICON_DISPLAY_HIDDEN -1
#define ICON_DISPLAY_DOCKED -2
/* 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
...
@@ -472,6 +473,8 @@ static void systray_add_icon( struct icon *icon )
...
@@ -472,6 +473,8 @@ static void systray_add_icon( struct icon *icon )
if
(
icon
->
display
!=
ICON_DISPLAY_HIDDEN
)
return
;
/* already added */
if
(
icon
->
display
!=
ICON_DISPLAY_HIDDEN
)
return
;
/* already added */
icon
->
display
=
nb_displayed
++
;
icon
->
display
=
nb_displayed
++
;
SetWindowLongW
(
icon
->
window
,
GWL_STYLE
,
GetWindowLongW
(
icon
->
window
,
GWL_STYLE
)
|
WS_CHILD
);
SetParent
(
icon
->
window
,
tray_window
);
pos
=
get_icon_pos
(
icon
);
pos
=
get_icon_pos
(
icon
);
SetWindowPos
(
icon
->
window
,
0
,
pos
.
x
,
pos
.
y
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOACTIVATE
|
SWP_NOZORDER
|
SWP_SHOWWINDOW
);
SetWindowPos
(
icon
->
window
,
0
,
pos
.
x
,
pos
.
y
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOACTIVATE
|
SWP_NOZORDER
|
SWP_SHOWWINDOW
);
...
@@ -502,6 +505,8 @@ static void systray_remove_icon( struct icon *icon )
...
@@ -502,6 +505,8 @@ static void systray_remove_icon( struct icon *icon )
TRACE
(
"removed %u now %d icons
\n
"
,
icon
->
id
,
nb_displayed
);
TRACE
(
"removed %u now %d icons
\n
"
,
icon
->
id
,
nb_displayed
);
icon
->
display
=
ICON_DISPLAY_HIDDEN
;
icon
->
display
=
ICON_DISPLAY_HIDDEN
;
SetParent
(
icon
->
window
,
GetDesktopWindow
()
);
SetWindowLongW
(
icon
->
window
,
GWL_STYLE
,
GetWindowLongW
(
icon
->
window
,
GWL_STYLE
)
&
~
WS_CHILD
);
}
}
/* make an icon visible */
/* make an icon visible */
...
@@ -511,6 +516,9 @@ static BOOL show_icon(struct icon *icon)
...
@@ -511,6 +516,9 @@ static BOOL show_icon(struct icon *icon)
if
(
icon
->
display
!=
ICON_DISPLAY_HIDDEN
)
return
TRUE
;
/* already displayed */
if
(
icon
->
display
!=
ICON_DISPLAY_HIDDEN
)
return
TRUE
;
/* already displayed */
if
(
!
enable_taskbar
&&
NtUserMessageCall
(
icon
->
window
,
WINE_SYSTRAY_DOCK_INSERT
,
icon_cx
,
icon_cy
,
icon
,
NtUserSystemTrayCall
,
FALSE
))
icon
->
display
=
ICON_DISPLAY_DOCKED
;
systray_add_icon
(
icon
);
systray_add_icon
(
icon
);
update_tooltip_position
(
icon
);
update_tooltip_position
(
icon
);
...
@@ -525,6 +533,9 @@ static BOOL hide_icon(struct icon *icon)
...
@@ -525,6 +533,9 @@ static BOOL hide_icon(struct icon *icon)
if
(
icon
->
display
==
ICON_DISPLAY_HIDDEN
)
return
TRUE
;
/* already hidden */
if
(
icon
->
display
==
ICON_DISPLAY_HIDDEN
)
return
TRUE
;
/* already hidden */
if
(
!
enable_taskbar
&&
NtUserMessageCall
(
icon
->
window
,
WINE_SYSTRAY_DOCK_REMOVE
,
0
,
0
,
NULL
,
NtUserSystemTrayCall
,
FALSE
))
icon
->
display
=
ICON_DISPLAY_HIDDEN
;
ShowWindow
(
icon
->
window
,
SW_HIDE
);
ShowWindow
(
icon
->
window
,
SW_HIDE
);
systray_remove_icon
(
icon
);
systray_remove_icon
(
icon
);
...
@@ -554,7 +565,12 @@ static BOOL modify_icon( struct icon *icon, NOTIFYICONDATAW *nid )
...
@@ -554,7 +565,12 @@ static BOOL modify_icon( struct icon *icon, NOTIFYICONDATAW *nid )
{
{
if
(
icon
->
image
)
DestroyIcon
(
icon
->
image
);
if
(
icon
->
image
)
DestroyIcon
(
icon
->
image
);
icon
->
image
=
CopyIcon
(
nid
->
hIcon
);
icon
->
image
=
CopyIcon
(
nid
->
hIcon
);
if
(
icon
->
display
>=
0
)
InvalidateRect
(
icon
->
window
,
NULL
,
TRUE
);
if
(
icon
->
display
>=
0
)
InvalidateRect
(
icon
->
window
,
NULL
,
TRUE
);
else
if
(
!
enable_taskbar
)
NtUserMessageCall
(
icon
->
window
,
WINE_SYSTRAY_DOCK_CLEAR
,
0
,
0
,
NULL
,
NtUserSystemTrayCall
,
FALSE
);
}
}
if
(
nid
->
uFlags
&
NIF_MESSAGE
)
if
(
nid
->
uFlags
&
NIF_MESSAGE
)
...
@@ -604,8 +620,8 @@ static BOOL add_icon(NOTIFYICONDATAW *nid)
...
@@ -604,8 +620,8 @@ static BOOL add_icon(NOTIFYICONDATAW *nid)
icon
->
owner
=
nid
->
hWnd
;
icon
->
owner
=
nid
->
hWnd
;
icon
->
display
=
ICON_DISPLAY_HIDDEN
;
icon
->
display
=
ICON_DISPLAY_HIDDEN
;
CreateWindow
W
(
tray_icon_class
.
lpszClassName
,
NULL
,
WS_CHILD
,
CreateWindow
ExW
(
0
,
tray_icon_class
.
lpszClassName
,
NULL
,
WS_CLIPSIBLINGS
|
WS_POPUP
,
0
,
0
,
icon_cx
,
icon_cy
,
tray_window
,
NULL
,
NULL
,
icon
);
0
,
0
,
icon_cx
,
icon_cy
,
0
,
NULL
,
NULL
,
icon
);
if
(
!
icon
->
window
)
ERR
(
"Failed to create systray icon window
\n
"
);
if
(
!
icon
->
window
)
ERR
(
"Failed to create systray icon window
\n
"
);
list_add_tail
(
&
icon_list
,
&
icon
->
entry
);
list_add_tail
(
&
icon_list
,
&
icon
->
entry
);
...
@@ -1027,6 +1043,7 @@ void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enab
...
@@ -1027,6 +1043,7 @@ void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enab
SIZE
size
=
get_window_size
();
SIZE
size
=
get_window_size
();
tray_window
=
CreateWindowExW
(
0
,
shell_traywnd_class
.
lpszClassName
,
L""
,
WS_CAPTION
|
WS_SYSMENU
,
tray_window
=
CreateWindowExW
(
0
,
shell_traywnd_class
.
lpszClassName
,
L""
,
WS_CAPTION
|
WS_SYSMENU
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
size
.
cx
,
size
.
cy
,
0
,
0
,
0
,
0
);
CW_USEDEFAULT
,
CW_USEDEFAULT
,
size
.
cx
,
size
.
cy
,
0
,
0
,
0
,
0
);
NtUserMessageCall
(
tray_window
,
WINE_SYSTRAY_DOCK_INIT
,
0
,
0
,
NULL
,
NtUserSystemTrayCall
,
FALSE
);
}
}
if
(
!
tray_window
)
if
(
!
tray_window
)
...
...
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