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
a97fd9f2
Commit
a97fd9f2
authored
Feb 21, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Feb 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Expose and use ProcessEvents from drivers instead of MsgWaitForMultipleObjectsEx.
parent
13a65b84
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
37 additions
and
80 deletions
+37
-80
dce.c
dlls/win32u/dce.c
+1
-2
driver.c
dlls/win32u/driver.c
+4
-8
input.c
dlls/win32u/input.c
+1
-2
message.c
dlls/win32u/message.c
+11
-5
android.h
dlls/wineandroid.drv/android.h
+1
-3
init.c
dlls/wineandroid.drv/init.c
+1
-1
window.c
dlls/wineandroid.drv/window.c
+4
-7
event.c
dlls/winemac.drv/event.c
+5
-22
gdi.c
dlls/winemac.drv/gdi.c
+1
-1
macdrv.h
dlls/winemac.drv/macdrv.h
+1
-3
event.c
dlls/winex11.drv/event.c
+4
-21
init.c
dlls/winex11.drv/init.c
+1
-1
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-3
gdi_driver.h
include/wine/gdi_driver.h
+1
-1
No files found.
dlls/win32u/dce.c
View file @
a97fd9f2
...
...
@@ -1449,7 +1449,6 @@ static void update_now( HWND hwnd, UINT rdw_flags )
*/
BOOL
WINAPI
NtUserRedrawWindow
(
HWND
hwnd
,
const
RECT
*
rect
,
HRGN
hrgn
,
UINT
flags
)
{
LARGE_INTEGER
zero
=
{
.
QuadPart
=
0
};
static
const
RECT
empty
;
BOOL
ret
;
...
...
@@ -1470,7 +1469,7 @@ BOOL WINAPI NtUserRedrawWindow( HWND hwnd, const RECT *rect, HRGN hrgn, UINT fla
}
/* process pending expose events before painting */
if
(
flags
&
RDW_UPDATENOW
)
user_driver
->
p
MsgWaitForMultipleObjectsEx
(
0
,
NULL
,
&
zero
,
QS_PAINT
,
0
);
if
(
flags
&
RDW_UPDATENOW
)
user_driver
->
p
ProcessEvents
(
QS_PAINT
);
if
(
rect
&&
!
hrgn
)
{
...
...
dlls/win32u/driver.c
View file @
a97fd9f2
...
...
@@ -806,13 +806,9 @@ static void nulldrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rec
{
}
static
NTSTATUS
nulldrv_MsgWaitForMultipleObjectsEx
(
DWORD
count
,
const
HANDLE
*
handles
,
const
LARGE_INTEGER
*
timeout
,
DWORD
mask
,
DWORD
flags
)
static
BOOL
nulldrv_ProcessEvents
(
DWORD
mask
)
{
if
(
!
count
&&
timeout
&&
!
timeout
->
QuadPart
)
return
WAIT_TIMEOUT
;
return
NtWaitForMultipleObjects
(
count
,
handles
,
!
(
flags
&
MWMO_WAITALL
),
!!
(
flags
&
MWMO_ALERTABLE
),
timeout
);
return
FALSE
;
}
static
void
nulldrv_ReleaseDC
(
HWND
hwnd
,
HDC
hdc
)
...
...
@@ -1193,7 +1189,7 @@ static const struct user_driver_funcs lazy_load_driver =
nulldrv_DestroyWindow
,
loaderdrv_FlashWindowEx
,
loaderdrv_GetDC
,
nulldrv_
MsgWaitForMultipleObjectsEx
,
nulldrv_
ProcessEvents
,
nulldrv_ReleaseDC
,
nulldrv_ScrollDC
,
nulldrv_SetCapture
,
...
...
@@ -1268,7 +1264,7 @@ void __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version
SET_USER_FUNC
(
DestroyWindow
);
SET_USER_FUNC
(
FlashWindowEx
);
SET_USER_FUNC
(
GetDC
);
SET_USER_FUNC
(
MsgWaitForMultipleObjectsEx
);
SET_USER_FUNC
(
ProcessEvents
);
SET_USER_FUNC
(
ReleaseDC
);
SET_USER_FUNC
(
ScrollDC
);
SET_USER_FUNC
(
SetCapture
);
...
...
dlls/win32u/input.c
View file @
a97fd9f2
...
...
@@ -750,8 +750,7 @@ BOOL WINAPI NtUserGetCursorInfo( CURSORINFO *info )
static
void
check_for_events
(
UINT
flags
)
{
LARGE_INTEGER
zero
=
{
.
QuadPart
=
0
};
if
(
user_driver
->
pMsgWaitForMultipleObjectsEx
(
0
,
NULL
,
&
zero
,
flags
,
0
)
==
WAIT_TIMEOUT
)
if
(
!
user_driver
->
pProcessEvents
(
flags
))
flush_window_surfaces
(
TRUE
);
}
...
...
dlls/win32u/message.c
View file @
a97fd9f2
...
...
@@ -2086,9 +2086,8 @@ static inline void check_for_driver_events( UINT msg )
{
if
(
get_user_thread_info
()
->
message_count
>
200
)
{
LARGE_INTEGER
zero
=
{
.
QuadPart
=
0
};
flush_window_surfaces
(
FALSE
);
user_driver
->
p
MsgWaitForMultipleObjectsEx
(
0
,
NULL
,
&
zero
,
QS_ALLINPUT
,
0
);
user_driver
->
p
ProcessEvents
(
QS_ALLINPUT
);
}
else
if
(
msg
==
WM_TIMER
||
msg
==
WM_SYSTIMER
)
{
...
...
@@ -2117,13 +2116,20 @@ static DWORD wait_message( DWORD count, const HANDLE *handles, DWORD timeout, DW
if
(
enable_thunk_lock
)
lock
=
KeUserModeCallback
(
NtUserThunkLock
,
NULL
,
0
,
&
ret_ptr
,
&
ret_len
);
ret
=
user_driver
->
pMsgWaitForMultipleObjectsEx
(
count
,
handles
,
get_nt_timeout
(
&
time
,
timeout
),
mask
,
flags
);
if
(
HIWORD
(
ret
))
/* is it an error code? */
if
(
user_driver
->
pProcessEvents
(
mask
))
ret
=
count
?
count
-
1
:
0
;
else
if
(
count
)
{
ret
=
NtWaitForMultipleObjects
(
count
,
handles
,
!
(
flags
&
MWMO_WAITALL
),
!!
(
flags
&
MWMO_ALERTABLE
),
get_nt_timeout
(
&
time
,
timeout
));
if
(
ret
==
count
-
1
)
user_driver
->
pProcessEvents
(
mask
);
else
if
(
HIWORD
(
ret
))
/* is it an error code? */
{
RtlSetLastWin32Error
(
RtlNtStatusToDosError
(
ret
)
);
ret
=
WAIT_FAILED
;
}
}
else
ret
=
WAIT_TIMEOUT
;
if
(
ret
==
WAIT_TIMEOUT
&&
!
count
&&
!
timeout
)
NtYieldExecution
();
if
((
mask
&
QS_INPUT
)
==
QS_INPUT
)
get_user_thread_info
()
->
message_count
=
0
;
...
...
dlls/wineandroid.drv/android.h
View file @
a97fd9f2
...
...
@@ -89,9 +89,7 @@ extern SHORT ANDROID_VkKeyScanEx( WCHAR ch, HKL hkl ) DECLSPEC_HIDDEN;
extern
void
ANDROID_SetCursor
(
HCURSOR
handle
)
DECLSPEC_HIDDEN
;
extern
BOOL
ANDROID_CreateWindow
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
void
ANDROID_DestroyWindow
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
ANDROID_MsgWaitForMultipleObjectsEx
(
DWORD
count
,
const
HANDLE
*
handles
,
const
LARGE_INTEGER
*
timeout
,
DWORD
mask
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
extern
BOOL
ANDROID_ProcessEvents
(
DWORD
mask
)
DECLSPEC_HIDDEN
;
extern
LRESULT
ANDROID_DesktopWindowProc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
)
DECLSPEC_HIDDEN
;
extern
void
ANDROID_SetCursor
(
HCURSOR
handle
)
DECLSPEC_HIDDEN
;
extern
void
ANDROID_SetLayeredWindowAttributes
(
HWND
hwnd
,
COLORREF
key
,
BYTE
alpha
,
...
...
dlls/wineandroid.drv/init.c
View file @
a97fd9f2
...
...
@@ -352,7 +352,7 @@ static const struct user_driver_funcs android_drv_funcs =
.
pCreateWindow
=
ANDROID_CreateWindow
,
.
pDesktopWindowProc
=
ANDROID_DesktopWindowProc
,
.
pDestroyWindow
=
ANDROID_DestroyWindow
,
.
p
MsgWaitForMultipleObjectsEx
=
ANDROID_MsgWaitForMultipleObjectsEx
,
.
p
ProcessEvents
=
ANDROID_ProcessEvents
,
.
pSetCapture
=
ANDROID_SetCapture
,
.
pSetLayeredWindowAttributes
=
ANDROID_SetLayeredWindowAttributes
,
.
pSetParent
=
ANDROID_SetParent
,
...
...
dlls/wineandroid.drv/window.c
View file @
a97fd9f2
...
...
@@ -1200,20 +1200,17 @@ LRESULT ANDROID_DesktopWindowProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
/***********************************************************************
* ANDROID_
MsgWaitForMultipleObjectsEx
* ANDROID_
ProcessEvents
*/
NTSTATUS
ANDROID_MsgWaitForMultipleObjectsEx
(
DWORD
count
,
const
HANDLE
*
handles
,
const
LARGE_INTEGER
*
timeout
,
DWORD
mask
,
DWORD
flags
)
BOOL
ANDROID_ProcessEvents
(
DWORD
mask
)
{
if
(
GetCurrentThreadId
()
==
desktop_tid
)
{
/* don't process nested events */
if
(
current_event
)
mask
=
0
;
if
(
process_events
(
mask
))
return
count
-
1
;
return
process_events
(
mask
)
;
}
return
NtWaitForMultipleObjects
(
count
,
handles
,
!
(
flags
&
MWMO_WAITALL
),
!!
(
flags
&
MWMO_ALERTABLE
),
timeout
);
return
FALSE
;
}
/**********************************************************************
...
...
dlls/winemac.drv/event.c
View file @
a97fd9f2
...
...
@@ -510,24 +510,16 @@ static int process_events(macdrv_event_queue queue, macdrv_event_mask mask)
/***********************************************************************
*
MsgWaitForMultipleObjectsEx
(MACDRV.@)
*
ProcessEvents
(MACDRV.@)
*/
NTSTATUS
macdrv_MsgWaitForMultipleObjectsEx
(
DWORD
count
,
const
HANDLE
*
handles
,
const
LARGE_INTEGER
*
timeout
,
DWORD
mask
,
DWORD
flags
)
NTSTATUS
macdrv_ProcessEvents
(
DWORD
mask
)
{
DWORD
ret
;
struct
macdrv_thread_data
*
data
=
macdrv_thread_data
();
macdrv_event_mask
event_mask
=
get_event_mask
(
mask
);
TRACE
(
"count %d, handles %p, timeout %p, mask %x, flags %x
\n
"
,
(
unsigned
int
)
count
,
handles
,
timeout
,
(
unsigned
int
)
mask
,
(
unsigned
int
)
flags
);
TRACE
(
"mask %x
\n
"
,
(
unsigned
int
)
mask
);
if
(
!
data
)
{
if
(
!
count
&&
timeout
&&
!
timeout
->
QuadPart
)
return
WAIT_TIMEOUT
;
return
NtWaitForMultipleObjects
(
count
,
handles
,
!
(
flags
&
MWMO_WAITALL
),
!!
(
flags
&
MWMO_ALERTABLE
),
timeout
);
}
if
(
!
data
)
return
FALSE
;
if
(
data
->
current_event
&&
data
->
current_event
->
type
!=
QUERY_EVENT
&&
data
->
current_event
->
type
!=
QUERY_EVENT_NO_PREEMPT_WAIT
&&
...
...
@@ -535,14 +527,5 @@ NTSTATUS macdrv_MsgWaitForMultipleObjectsEx(DWORD count, const HANDLE *handles,
data
->
current_event
->
type
!=
WINDOW_DRAG_BEGIN
)
event_mask
=
0
;
/* don't process nested events */
if
(
process_events
(
data
->
queue
,
event_mask
))
ret
=
count
-
1
;
else
if
(
count
||
!
timeout
||
timeout
->
QuadPart
)
{
ret
=
NtWaitForMultipleObjects
(
count
,
handles
,
!
(
flags
&
MWMO_WAITALL
),
!!
(
flags
&
MWMO_ALERTABLE
),
timeout
);
if
(
ret
==
count
-
1
)
process_events
(
data
->
queue
,
event_mask
);
}
else
ret
=
WAIT_TIMEOUT
;
return
ret
;
return
process_events
(
data
->
queue
,
event_mask
);
}
dlls/winemac.drv/gdi.c
View file @
a97fd9f2
...
...
@@ -282,7 +282,7 @@ static const struct user_driver_funcs macdrv_funcs =
.
pGetKeyboardLayoutList
=
macdrv_GetKeyboardLayoutList
,
.
pGetKeyNameText
=
macdrv_GetKeyNameText
,
.
pMapVirtualKeyEx
=
macdrv_MapVirtualKeyEx
,
.
p
MsgWaitForMultipleObjectsEx
=
macdrv_MsgWaitForMultipleObjectsEx
,
.
p
ProcessEvents
=
macdrv_ProcessEvents
,
.
pRegisterHotKey
=
macdrv_RegisterHotKey
,
.
pSetCapture
=
macdrv_SetCapture
,
.
pSetCursor
=
macdrv_SetCursor
,
...
...
dlls/winemac.drv/macdrv.h
View file @
a97fd9f2
...
...
@@ -169,9 +169,7 @@ extern UINT macdrv_GetKeyboardLayoutList(INT size, HKL *list) DECLSPEC_HIDDEN;
extern
INT
macdrv_GetKeyNameText
(
LONG
lparam
,
LPWSTR
buffer
,
INT
size
)
DECLSPEC_HIDDEN
;
extern
BOOL
macdrv_SystemParametersInfo
(
UINT
action
,
UINT
int_param
,
void
*
ptr_param
,
UINT
flags
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
macdrv_MsgWaitForMultipleObjectsEx
(
DWORD
count
,
const
HANDLE
*
handles
,
const
LARGE_INTEGER
*
timeout
,
DWORD
mask
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
extern
BOOL
macdrv_ProcessEvents
(
DWORD
mask
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_ThreadDetach
(
void
)
DECLSPEC_HIDDEN
;
...
...
dlls/winex11.drv/event.c
View file @
a97fd9f2
...
...
@@ -472,33 +472,16 @@ static BOOL process_events( Display *display, Bool (*filter)(Display*, XEvent*,X
/***********************************************************************
*
MsgWaitForMultipleObjectsEx
(X11DRV.@)
*
ProcessEvents
(X11DRV.@)
*/
NTSTATUS
X11DRV_MsgWaitForMultipleObjectsEx
(
DWORD
count
,
const
HANDLE
*
handles
,
const
LARGE_INTEGER
*
timeout
,
DWORD
mask
,
DWORD
flags
)
BOOL
X11DRV_ProcessEvents
(
DWORD
mask
)
{
struct
x11drv_thread_data
*
data
=
x11drv_thread_data
();
NTSTATUS
ret
;
if
(
!
data
)
{
if
(
!
count
&&
timeout
&&
!
timeout
->
QuadPart
)
return
WAIT_TIMEOUT
;
return
NtWaitForMultipleObjects
(
count
,
handles
,
!
(
flags
&
MWMO_WAITALL
),
!!
(
flags
&
MWMO_ALERTABLE
),
timeout
);
}
if
(
!
data
)
return
FALSE
;
if
(
data
->
current_event
)
mask
=
0
;
/* don't process nested events */
if
(
process_events
(
data
->
display
,
filter_event
,
mask
))
ret
=
count
-
1
;
else
if
(
count
||
!
timeout
||
timeout
->
QuadPart
)
{
ret
=
NtWaitForMultipleObjects
(
count
,
handles
,
!
(
flags
&
MWMO_WAITALL
),
!!
(
flags
&
MWMO_ALERTABLE
),
timeout
);
if
(
ret
==
count
-
1
)
process_events
(
data
->
display
,
filter_event
,
mask
);
}
else
ret
=
WAIT_TIMEOUT
;
return
ret
;
return
process_events
(
data
->
display
,
filter_event
,
mask
);
}
/***********************************************************************
...
...
dlls/winex11.drv/init.c
View file @
a97fd9f2
...
...
@@ -413,7 +413,7 @@ static const struct user_driver_funcs x11drv_funcs =
.
pDestroyWindow
=
X11DRV_DestroyWindow
,
.
pFlashWindowEx
=
X11DRV_FlashWindowEx
,
.
pGetDC
=
X11DRV_GetDC
,
.
p
MsgWaitForMultipleObjectsEx
=
X11DRV_MsgWaitForMultipleObjectsEx
,
.
p
ProcessEvents
=
X11DRV_ProcessEvents
,
.
pReleaseDC
=
X11DRV_ReleaseDC
,
.
pScrollDC
=
X11DRV_ScrollDC
,
.
pSetCapture
=
X11DRV_SetCapture
,
...
...
dlls/winex11.drv/x11drv.h
View file @
a97fd9f2
...
...
@@ -691,9 +691,7 @@ extern void retry_grab_clipping_window(void) DECLSPEC_HIDDEN;
extern
BOOL
clip_fullscreen_window
(
HWND
hwnd
,
BOOL
reset
)
DECLSPEC_HIDDEN
;
extern
void
move_resize_window
(
HWND
hwnd
,
int
dir
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_InitKeyboard
(
Display
*
display
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
X11DRV_MsgWaitForMultipleObjectsEx
(
DWORD
count
,
const
HANDLE
*
handles
,
const
LARGE_INTEGER
*
timeout
,
DWORD
mask
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
extern
BOOL
X11DRV_ProcessEvents
(
DWORD
mask
)
DECLSPEC_HIDDEN
;
extern
HWND
*
build_hwnd_list
(
void
)
DECLSPEC_HIDDEN
;
typedef
int
(
*
x11drv_error_callback
)(
Display
*
display
,
XErrorEvent
*
event
,
void
*
arg
);
...
...
include/wine/gdi_driver.h
View file @
a97fd9f2
...
...
@@ -308,7 +308,7 @@ struct user_driver_funcs
void
(
*
pDestroyWindow
)(
HWND
);
void
(
*
pFlashWindowEx
)(
FLASHWINFO
*
);
void
(
*
pGetDC
)(
HDC
,
HWND
,
HWND
,
const
RECT
*
,
const
RECT
*
,
DWORD
);
NTSTATUS
(
*
pMsgWaitForMultipleObjectsEx
)(
DWORD
,
const
HANDLE
*
,
const
LARGE_INTEGER
*
,
DWORD
,
DWORD
);
BOOL
(
*
pProcessEvents
)(
DWORD
);
void
(
*
pReleaseDC
)(
HWND
,
HDC
);
BOOL
(
*
pScrollDC
)(
HDC
,
INT
,
INT
,
HRGN
);
void
(
*
pSetCapture
)(
HWND
,
UINT
);
...
...
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