Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
fded7c1d
Commit
fded7c1d
authored
Sep 14, 2023
by
Connor McAdams
Committed by
Alexandre Julliard
Sep 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uiautomationcore: Make sure event thread is started when listening for WinEvents.
Signed-off-by:
Connor McAdams
<
cmcadams@codeweavers.com
>
parent
81caccbf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
uia_event.c
dlls/uiautomationcore/uia_event.c
+14
-5
uia_private.h
dlls/uiautomationcore/uia_private.h
+1
-0
No files found.
dlls/uiautomationcore/uia_event.c
View file @
fded7c1d
...
...
@@ -79,8 +79,12 @@ static BOOL CALLBACK uia_win_event_enum_top_level_hwnds(HWND hwnd, LPARAM lparam
return
TRUE
;
}
static
BOOL
uia_clientside_event_start_event_thread
(
struct
uia_event
*
event
);
HRESULT
uia_event_add_win_event_hwnd
(
struct
uia_event
*
event
,
HWND
hwnd
)
{
if
(
!
uia_clientside_event_start_event_thread
(
event
))
return
E_FAIL
;
if
(
hwnd
==
GetDesktopWindow
())
EnumWindows
(
uia_win_event_enum_top_level_hwnds
,
(
LPARAM
)
&
event
->
u
.
clientside
.
win_event_hwnd_map
);
...
...
@@ -630,6 +634,14 @@ static void uia_stop_event_thread(void)
LeaveCriticalSection
(
&
event_thread_cs
);
}
static
BOOL
uia_clientside_event_start_event_thread
(
struct
uia_event
*
event
)
{
if
(
!
event
->
u
.
clientside
.
event_thread_started
)
event
->
u
.
clientside
.
event_thread_started
=
uia_start_event_thread
();
return
event
->
u
.
clientside
.
event_thread_started
;
}
/*
* IWineUiaEvent interface.
*/
...
...
@@ -679,7 +691,7 @@ static ULONG WINAPI uia_event_Release(IWineUiaEvent *iface)
if
(
event
->
event_type
==
EVENT_TYPE_CLIENTSIDE
)
{
uia_cache_request_destroy
(
&
event
->
u
.
clientside
.
cache_req
);
if
(
event
->
u
.
clientside
.
git_cookie
)
if
(
event
->
u
.
clientside
.
event_thread_started
)
uia_stop_event_thread
();
uia_hwnd_map_destroy
(
&
event
->
u
.
clientside
.
win_event_hwnd_map
);
}
...
...
@@ -1160,16 +1172,13 @@ HRESULT uia_event_add_serverside_event_adviser(IWineUiaEvent *serverside_event,
*/
if
(
!
event
->
u
.
clientside
.
git_cookie
)
{
if
(
!
uia_
start_event_thread
(
))
if
(
!
uia_
clientside_event_start_event_thread
(
event
))
return
E_FAIL
;
hr
=
register_interface_in_git
((
IUnknown
*
)
&
event
->
IWineUiaEvent_iface
,
&
IID_IWineUiaEvent
,
&
event
->
u
.
clientside
.
git_cookie
);
if
(
FAILED
(
hr
))
{
uia_stop_event_thread
();
return
hr
;
}
}
if
(
!
(
adv_events
=
calloc
(
1
,
sizeof
(
*
adv_events
))))
...
...
dlls/uiautomationcore/uia_private.h
View file @
fded7c1d
...
...
@@ -142,6 +142,7 @@ struct uia_event
void
*
callback_data
;
struct
rb_tree
win_event_hwnd_map
;
BOOL
event_thread_started
;
DWORD
git_cookie
;
}
clientside
;
struct
{
...
...
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