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
e352fa19
Commit
e352fa19
authored
May 02, 2023
by
Alexandros Frantzis
Committed by
Alexandre Julliard
May 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winewayland.drv: Allocate process_wayland statically.
There is currently no benefit to dynamic allocation, and static allocation allows us to simplify some aspects of initialization.
parent
5eeed9ab
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
30 deletions
+25
-30
display.c
dlls/winewayland.drv/display.c
+1
-1
wayland.c
dlls/winewayland.drv/wayland.c
+18
-23
wayland_output.c
dlls/winewayland.drv/wayland_output.c
+4
-4
waylanddrv.h
dlls/winewayland.drv/waylanddrv.h
+2
-2
No files found.
dlls/winewayland.drv/display.c
View file @
e352fa19
...
...
@@ -290,7 +290,7 @@ BOOL WAYLAND_UpdateDisplayDevices(const struct gdi_device_manager *device_manage
wl_array_init
(
&
output_info_array
);
wl_list_for_each
(
output
,
&
process_wayland
->
output_list
,
link
)
wl_list_for_each
(
output
,
&
process_wayland
.
output_list
,
link
)
{
if
(
!
output
->
current_mode
)
continue
;
output_info
=
wl_array_add
(
&
output_info_array
,
sizeof
(
*
output_info
));
...
...
dlls/winewayland.drv/wayland.c
View file @
e352fa19
...
...
@@ -32,8 +32,10 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
waylanddrv
);
struct
wl_display
*
process_wl_display
=
NULL
;
struct
wayland
*
process_wayland
=
NULL
;
struct
wayland
process_wayland
=
{
.
output_list
=
{
&
process_wayland
.
output_list
,
&
process_wayland
.
output_list
}
};
/**********************************************************************
* Registry handling
...
...
@@ -54,12 +56,12 @@ static void registry_handle_global(void *data, struct wl_registry *registry,
{
struct
wayland_output
*
output
;
process_wayland
->
zxdg_output_manager_v1
=
process_wayland
.
zxdg_output_manager_v1
=
wl_registry_bind
(
registry
,
id
,
&
zxdg_output_manager_v1_interface
,
version
<
3
?
version
:
3
);
/* Add zxdg_output_v1 to existing outputs. */
wl_list_for_each
(
output
,
&
process_wayland
->
output_list
,
link
)
wl_list_for_each
(
output
,
&
process_wayland
.
output_list
,
link
)
wayland_output_use_xdg_extension
(
output
);
}
}
...
...
@@ -71,7 +73,7 @@ static void registry_handle_global_remove(void *data, struct wl_registry *regist
TRACE
(
"id=%u
\n
"
,
id
);
wl_list_for_each_safe
(
output
,
tmp
,
&
process_wayland
->
output_list
,
link
)
wl_list_for_each_safe
(
output
,
tmp
,
&
process_wayland
.
output_list
,
link
)
{
if
(
output
->
global_id
==
id
)
{
...
...
@@ -97,48 +99,41 @@ BOOL wayland_process_init(void)
{
struct
wl_display
*
wl_display_wrapper
;
process_wl_display
=
wl_display_connect
(
NULL
);
if
(
!
process_wl_display
)
process_w
ayland
.
w
l_display
=
wl_display_connect
(
NULL
);
if
(
!
process_w
ayland
.
w
l_display
)
return
FALSE
;
process_wayland
=
calloc
(
1
,
sizeof
(
*
process_wayland
));
if
(
!
process_wayland
)
return
FALSE
;
TRACE
(
"wl_display=%p
\n
"
,
process_wayland
.
wl_display
);
TRACE
(
"process_wayland=%p wl_display=%p
\n
"
,
process_wayland
,
process_wl_display
);
if
(
!
(
process_wayland
->
wl_event_queue
=
wl_display_create_queue
(
process_wl_display
)))
if
(
!
(
process_wayland
.
wl_event_queue
=
wl_display_create_queue
(
process_wayland
.
wl_display
)))
{
ERR
(
"Failed to create event queue
\n
"
);
return
FALSE
;
}
if
(
!
(
wl_display_wrapper
=
wl_proxy_create_wrapper
(
process_wl_display
)))
if
(
!
(
wl_display_wrapper
=
wl_proxy_create_wrapper
(
process_w
ayland
.
w
l_display
)))
{
ERR
(
"Failed to create proxy wrapper for wl_display
\n
"
);
return
FALSE
;
}
wl_proxy_set_queue
((
struct
wl_proxy
*
)
wl_display_wrapper
,
process_wayland
->
wl_event_queue
);
process_wayland
.
wl_event_queue
);
process_wayland
->
wl_registry
=
wl_display_get_registry
(
wl_display_wrapper
);
process_wayland
.
wl_registry
=
wl_display_get_registry
(
wl_display_wrapper
);
wl_proxy_wrapper_destroy
(
wl_display_wrapper
);
if
(
!
process_wayland
->
wl_registry
)
if
(
!
process_wayland
.
wl_registry
)
{
ERR
(
"Failed to get to wayland registry
\n
"
);
return
FALSE
;
}
wl_list_init
(
&
process_wayland
->
output_list
);
/* Populate registry */
wl_registry_add_listener
(
process_wayland
->
wl_registry
,
&
registry_listener
,
process_wayland
);
wl_registry_add_listener
(
process_wayland
.
wl_registry
,
&
registry_listener
,
NULL
);
/* We need two roundtrips. One to get and bind globals, one to handle all
* initial events produced from registering the globals. */
wl_display_roundtrip_queue
(
process_w
l_display
,
process_wayland
->
wl_event_queue
);
wl_display_roundtrip_queue
(
process_w
l_display
,
process_wayland
->
wl_event_queue
);
wl_display_roundtrip_queue
(
process_w
ayland
.
wl_display
,
process_wayland
.
wl_event_queue
);
wl_display_roundtrip_queue
(
process_w
ayland
.
wl_display
,
process_wayland
.
wl_event_queue
);
wayland_init_display_devices
();
...
...
dlls/winewayland.drv/wayland_output.c
View file @
e352fa19
...
...
@@ -230,7 +230,7 @@ BOOL wayland_output_create(uint32_t id, uint32_t version)
goto
err
;
}
output
->
wl_output
=
wl_registry_bind
(
process_wayland
->
wl_registry
,
id
,
output
->
wl_output
=
wl_registry_bind
(
process_wayland
.
wl_registry
,
id
,
&
wl_output_interface
,
version
<
2
?
version
:
2
);
output
->
global_id
=
id
;
...
...
@@ -252,10 +252,10 @@ BOOL wayland_output_create(uint32_t id, uint32_t version)
goto
err
;
}
if
(
process_wayland
->
zxdg_output_manager_v1
)
if
(
process_wayland
.
zxdg_output_manager_v1
)
wayland_output_use_xdg_extension
(
output
);
wl_list_insert
(
process_wayland
->
output_list
.
prev
,
&
output
->
link
);
wl_list_insert
(
process_wayland
.
output_list
.
prev
,
&
output
->
link
);
return
TRUE
;
...
...
@@ -293,7 +293,7 @@ void wayland_output_destroy(struct wayland_output *output)
void
wayland_output_use_xdg_extension
(
struct
wayland_output
*
output
)
{
output
->
zxdg_output_v1
=
zxdg_output_manager_v1_get_xdg_output
(
process_wayland
->
zxdg_output_manager_v1
,
zxdg_output_manager_v1_get_xdg_output
(
process_wayland
.
zxdg_output_manager_v1
,
output
->
wl_output
);
zxdg_output_v1_add_listener
(
output
->
zxdg_output_v1
,
&
zxdg_output_v1_listener
,
output
);
...
...
dlls/winewayland.drv/waylanddrv.h
View file @
e352fa19
...
...
@@ -39,8 +39,7 @@
* Globals
*/
extern
struct
wl_display
*
process_wl_display
DECLSPEC_HIDDEN
;
extern
struct
wayland
*
process_wayland
DECLSPEC_HIDDEN
;
extern
struct
wayland
process_wayland
DECLSPEC_HIDDEN
;
/**********************************************************************
* Definitions for wayland types
...
...
@@ -48,6 +47,7 @@ extern struct wayland *process_wayland DECLSPEC_HIDDEN;
struct
wayland
{
struct
wl_display
*
wl_display
;
struct
wl_event_queue
*
wl_event_queue
;
struct
wl_registry
*
wl_registry
;
struct
zxdg_output_manager_v1
*
zxdg_output_manager_v1
;
...
...
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