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
4a69ec6f
Commit
4a69ec6f
authored
Apr 24, 2023
by
Alexandros Frantzis
Committed by
Alexandre Julliard
May 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winewayland.drv: Read and dispatch Wayland events.
Create a dedicated thread from which we read and dispatch Wayland events (beyond the initial ones).
parent
e352fa19
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
dllmain.c
dlls/winewayland.drv/dllmain.c
+20
-0
unixlib.h
dlls/winewayland.drv/unixlib.h
+1
-0
waylanddrv_main.c
dlls/winewayland.drv/waylanddrv_main.c
+12
-0
No files found.
dlls/winewayland.drv/dllmain.c
View file @
4a69ec6f
...
...
@@ -20,8 +20,25 @@
#include "waylanddrv_dll.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
waylanddrv
);
static
DWORD
WINAPI
wayland_read_events_thread
(
void
*
arg
)
{
WAYLANDDRV_UNIX_CALL
(
read_events
,
NULL
);
/* This thread terminates only if an unrecoverable error occurred
* during event reading (e.g., the connection to the Wayland
* compositor is broken). */
ERR
(
"Failed to read events from the compositor, terminating process
\n
"
);
TerminateProcess
(
GetCurrentProcess
(),
1
);
return
0
;
}
BOOL
WINAPI
DllMain
(
HINSTANCE
instance
,
DWORD
reason
,
void
*
reserved
)
{
DWORD
tid
;
if
(
reason
!=
DLL_PROCESS_ATTACH
)
return
TRUE
;
DisableThreadLibraryCalls
(
instance
);
...
...
@@ -30,5 +47,8 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
if
(
WAYLANDDRV_UNIX_CALL
(
init
,
NULL
))
return
FALSE
;
/* Read wayland events from a dedicated thread. */
CloseHandle
(
CreateThread
(
NULL
,
0
,
wayland_read_events_thread
,
NULL
,
0
,
&
tid
));
return
TRUE
;
}
dlls/winewayland.drv/unixlib.h
View file @
4a69ec6f
...
...
@@ -26,6 +26,7 @@
enum
waylanddrv_unix_func
{
waylanddrv_unix_func_init
,
waylanddrv_unix_func_read_events
,
waylanddrv_unix_func_count
,
};
...
...
dlls/winewayland.drv/waylanddrv_main.c
View file @
4a69ec6f
...
...
@@ -49,9 +49,20 @@ err:
return
STATUS_UNSUCCESSFUL
;
}
static
NTSTATUS
waylanddrv_unix_read_events
(
void
*
arg
)
{
while
(
wl_display_dispatch_queue
(
process_wayland
.
wl_display
,
process_wayland
.
wl_event_queue
)
!=
-
1
)
continue
;
/* This function only returns on a fatal error, e.g., if our connection
* to the Wayland server is lost. */
return
STATUS_UNSUCCESSFUL
;
}
const
unixlib_entry_t
__wine_unix_call_funcs
[]
=
{
waylanddrv_unix_init
,
waylanddrv_unix_read_events
,
};
C_ASSERT
(
ARRAYSIZE
(
__wine_unix_call_funcs
)
==
waylanddrv_unix_func_count
);
...
...
@@ -61,6 +72,7 @@ C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs) == waylanddrv_unix_func_count);
const
unixlib_entry_t
__wine_unix_call_wow64_funcs
[]
=
{
waylanddrv_unix_init
,
waylanddrv_unix_read_events
,
};
C_ASSERT
(
ARRAYSIZE
(
__wine_unix_call_wow64_funcs
)
==
waylanddrv_unix_func_count
);
...
...
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