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
e4163061
Commit
e4163061
authored
May 04, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
May 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Use unixlib interface for X11 calls from systray.c.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6290d059
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
26 deletions
+62
-26
systray.c
dlls/winex11.drv/systray.c
+7
-26
unixlib.h
dlls/winex11.drv/unixlib.h
+3
-0
window.c
dlls/winex11.drv/window.c
+46
-0
x11drv.h
dlls/winex11.drv/x11drv.h
+3
-0
x11drv_main.c
dlls/winex11.drv/x11drv_main.c
+3
-0
No files found.
dlls/winex11.drv/systray.c
View file @
e4163061
...
@@ -587,10 +587,13 @@ static BOOL init_systray(void)
...
@@ -587,10 +587,13 @@ static BOOL init_systray(void)
{
{
static
BOOL
init_done
;
static
BOOL
init_done
;
WNDCLASSEXW
class
;
WNDCLASSEXW
class
;
Display
*
display
;
if
(
is_virtual_desktop
())
return
FALSE
;
if
(
init_done
)
return
TRUE
;
if
(
init_done
)
return
TRUE
;
if
(
!
X11DRV_CALL
(
systray_init
,
NULL
))
{
init_done
=
TRUE
;
return
FALSE
;
}
icon_cx
=
GetSystemMetrics
(
SM_CXSMICON
)
+
2
*
ICON_BORDER
;
icon_cx
=
GetSystemMetrics
(
SM_CXSMICON
)
+
2
*
ICON_BORDER
;
icon_cy
=
GetSystemMetrics
(
SM_CYSMICON
)
+
2
*
ICON_BORDER
;
icon_cy
=
GetSystemMetrics
(
SM_CYSMICON
)
+
2
*
ICON_BORDER
;
...
@@ -620,17 +623,6 @@ static BOOL init_systray(void)
...
@@ -620,17 +623,6 @@ static BOOL init_systray(void)
return
FALSE
;
return
FALSE
;
}
}
display
=
thread_init_display
();
if
(
DefaultScreen
(
display
)
==
0
)
systray_atom
=
x11drv_atom
(
_NET_SYSTEM_TRAY_S0
);
else
{
char
systray_buffer
[
29
];
/* strlen(_NET_SYSTEM_TRAY_S4294967295)+1 */
sprintf
(
systray_buffer
,
"_NET_SYSTEM_TRAY_S%u"
,
DefaultScreen
(
display
)
);
systray_atom
=
XInternAtom
(
display
,
systray_buffer
,
False
);
}
XSelectInput
(
display
,
root_window
,
StructureNotifyMask
);
init_done
=
TRUE
;
init_done
=
TRUE
;
return
TRUE
;
return
TRUE
;
}
}
...
@@ -700,18 +692,11 @@ void change_systray_owner( Display *display, Window systray_window )
...
@@ -700,18 +692,11 @@ void change_systray_owner( Display *display, Window systray_window )
/* hide a tray icon */
/* hide a tray icon */
static
BOOL
hide_icon
(
struct
tray_icon
*
icon
)
static
BOOL
hide_icon
(
struct
tray_icon
*
icon
)
{
{
struct
x11drv_win_data
*
data
;
TRACE
(
"id=0x%x, hwnd=%p
\n
"
,
icon
->
id
,
icon
->
owner
);
TRACE
(
"id=0x%x, hwnd=%p
\n
"
,
icon
->
id
,
icon
->
owner
);
if
(
!
icon
->
window
)
return
TRUE
;
/* already hidden */
if
(
!
icon
->
window
)
return
TRUE
;
/* already hidden */
/* make sure we don't try to unmap it, it confuses some systray docks */
X11DRV_CALL
(
systray_hide
,
&
icon
->
window
);
if
((
data
=
get_win_data
(
icon
->
window
)))
{
if
(
data
->
embedded
)
data
->
mapped
=
FALSE
;
release_win_data
(
data
);
}
DestroyWindow
(
icon
->
window
);
DestroyWindow
(
icon
->
window
);
DestroyWindow
(
icon
->
tooltip
);
DestroyWindow
(
icon
->
tooltip
);
icon
->
window
=
0
;
icon
->
window
=
0
;
...
@@ -759,11 +744,7 @@ static BOOL modify_icon( struct tray_icon *icon, NOTIFYICONDATAW *nid )
...
@@ -759,11 +744,7 @@ static BOOL modify_icon( struct tray_icon *icon, NOTIFYICONDATAW *nid )
{
{
if
(
icon
->
display
!=
-
1
)
InvalidateRect
(
icon
->
window
,
NULL
,
TRUE
);
if
(
icon
->
display
!=
-
1
)
InvalidateRect
(
icon
->
window
,
NULL
,
TRUE
);
else
if
(
icon
->
layered
)
repaint_tray_icon
(
icon
);
else
if
(
icon
->
layered
)
repaint_tray_icon
(
icon
);
else
else
X11DRV_CALL
(
systray_clear
,
&
icon
->
window
);
{
Window
win
=
X11DRV_get_whole_window
(
icon
->
window
);
if
(
win
)
XClearArea
(
gdi_display
,
win
,
0
,
0
,
0
,
0
,
True
);
}
}
}
}
}
...
...
dlls/winex11.drv/unixlib.h
View file @
e4163061
...
@@ -24,6 +24,9 @@ enum x11drv_funcs
...
@@ -24,6 +24,9 @@ enum x11drv_funcs
unix_clipboard_message
,
unix_clipboard_message
,
unix_create_desktop
,
unix_create_desktop
,
unix_init
,
unix_init
,
unix_systray_clear
,
unix_systray_hide
,
unix_systray_init
,
unix_tablet_attach_queue
,
unix_tablet_attach_queue
,
unix_tablet_get_packet
,
unix_tablet_get_packet
,
unix_tablet_info
,
unix_tablet_info
,
...
...
dlls/winex11.drv/window.c
View file @
e4163061
...
@@ -2092,6 +2092,52 @@ HWND create_foreign_window( Display *display, Window xwin )
...
@@ -2092,6 +2092,52 @@ HWND create_foreign_window( Display *display, Window xwin )
}
}
NTSTATUS
x11drv_systray_init
(
void
*
arg
)
{
Display
*
display
;
if
(
is_virtual_desktop
())
return
FALSE
;
display
=
thread_init_display
();
if
(
DefaultScreen
(
display
)
==
0
)
systray_atom
=
x11drv_atom
(
_NET_SYSTEM_TRAY_S0
);
else
{
char
systray_buffer
[
29
];
/* strlen(_NET_SYSTEM_TRAY_S4294967295)+1 */
sprintf
(
systray_buffer
,
"_NET_SYSTEM_TRAY_S%u"
,
DefaultScreen
(
display
)
);
systray_atom
=
XInternAtom
(
display
,
systray_buffer
,
False
);
}
XSelectInput
(
display
,
root_window
,
StructureNotifyMask
);
return
TRUE
;
}
NTSTATUS
x11drv_systray_clear
(
void
*
arg
)
{
HWND
hwnd
=
*
(
HWND
*
)
arg
;
Window
win
=
X11DRV_get_whole_window
(
hwnd
);
if
(
win
)
XClearArea
(
gdi_display
,
win
,
0
,
0
,
0
,
0
,
True
);
return
0
;
}
NTSTATUS
x11drv_systray_hide
(
void
*
arg
)
{
HWND
hwnd
=
*
(
HWND
*
)
arg
;
struct
x11drv_win_data
*
data
;
/* make sure we don't try to unmap it, it confuses some systray docks */
if
((
data
=
get_win_data
(
hwnd
)))
{
if
(
data
->
embedded
)
data
->
mapped
=
FALSE
;
release_win_data
(
data
);
}
return
0
;
}
/***********************************************************************
/***********************************************************************
* X11DRV_get_whole_window
* X11DRV_get_whole_window
*
*
...
...
dlls/winex11.drv/x11drv.h
View file @
e4163061
...
@@ -827,6 +827,9 @@ static inline BOOL is_window_rect_mapped( const RECT *rect )
...
@@ -827,6 +827,9 @@ static inline BOOL is_window_rect_mapped( const RECT *rect )
extern
NTSTATUS
x11drv_clipboard_message
(
void
*
arg
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
x11drv_clipboard_message
(
void
*
arg
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
x11drv_create_desktop
(
void
*
arg
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
x11drv_create_desktop
(
void
*
arg
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
x11drv_systray_clear
(
void
*
arg
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
x11drv_systray_hide
(
void
*
arg
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
x11drv_systray_init
(
void
*
arg
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
x11drv_tablet_attach_queue
(
void
*
arg
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
x11drv_tablet_attach_queue
(
void
*
arg
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
x11drv_tablet_get_packet
(
void
*
arg
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
x11drv_tablet_get_packet
(
void
*
arg
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
x11drv_tablet_load_info
(
void
*
arg
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
x11drv_tablet_load_info
(
void
*
arg
)
DECLSPEC_HIDDEN
;
...
...
dlls/winex11.drv/x11drv_main.c
View file @
e4163061
...
@@ -977,6 +977,9 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
...
@@ -977,6 +977,9 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
x11drv_clipboard_message
,
x11drv_clipboard_message
,
x11drv_create_desktop
,
x11drv_create_desktop
,
x11drv_init
,
x11drv_init
,
x11drv_systray_clear
,
x11drv_systray_hide
,
x11drv_systray_init
,
x11drv_tablet_attach_queue
,
x11drv_tablet_attach_queue
,
x11drv_tablet_get_packet
,
x11drv_tablet_get_packet
,
x11drv_tablet_info
,
x11drv_tablet_info
,
...
...
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