Clear the internal paint flag in the server before returning a
WM_PAINT message to avoid an extra server round-trip.
This commit is contained in:
parent
454c1b7599
commit
b9a9de6eb9
|
@ -2692,11 +2692,6 @@ BOOL WINAPI PeekMessageW( MSG *msg_out, HWND hwnd, UINT first, UINT last, UINT f
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
WIN_RestoreWndsLock( locks );
|
|
||||||
|
|
||||||
if (msg.message == WM_PAINT) /* clear internal paint flag */
|
|
||||||
RedrawWindow( msg.hwnd, NULL, 0, RDW_NOINTERNALPAINT | RDW_NOCHILDREN );
|
|
||||||
|
|
||||||
if ((queue = QUEUE_Current()))
|
if ((queue = QUEUE_Current()))
|
||||||
{
|
{
|
||||||
queue->GetMessageTimeVal = msg.time;
|
queue->GetMessageTimeVal = msg.time;
|
||||||
|
@ -2706,6 +2701,8 @@ BOOL WINAPI PeekMessageW( MSG *msg_out, HWND hwnd, UINT first, UINT last, UINT f
|
||||||
|
|
||||||
HOOK_CallHooks( WH_GETMESSAGE, HC_ACTION, flags & PM_REMOVE, (LPARAM)&msg, TRUE );
|
HOOK_CallHooks( WH_GETMESSAGE, HC_ACTION, flags & PM_REMOVE, (LPARAM)&msg, TRUE );
|
||||||
|
|
||||||
|
WIN_RestoreWndsLock( locks );
|
||||||
|
|
||||||
/* copy back our internal safe copy of message data to msg_out.
|
/* copy back our internal safe copy of message data to msg_out.
|
||||||
* msg_out is a variable from the *program*, so it can't be used
|
* msg_out is a variable from the *program*, so it can't be used
|
||||||
* internally as it can get "corrupted" by our use of SendMessage()
|
* internally as it can get "corrupted" by our use of SendMessage()
|
||||||
|
|
|
@ -589,20 +589,22 @@ static struct window *find_child_to_repaint( struct window *parent, struct threa
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* find a window that needs to receive a WM_PAINT */
|
/* find a window that needs to receive a WM_PAINT; also clear its internal paint flag */
|
||||||
user_handle_t find_window_to_repaint( user_handle_t parent, struct thread *thread )
|
user_handle_t find_window_to_repaint( user_handle_t parent, struct thread *thread )
|
||||||
{
|
{
|
||||||
struct window *ptr, *win = find_child_to_repaint( top_window, thread );
|
struct window *ptr, *win = find_child_to_repaint( top_window, thread );
|
||||||
|
|
||||||
if (win)
|
if (win && parent)
|
||||||
{
|
{
|
||||||
if (!parent) return win->handle;
|
|
||||||
/* check that it is a child of the specified parent */
|
/* check that it is a child of the specified parent */
|
||||||
for (ptr = win; ptr; ptr = ptr->parent)
|
for (ptr = win; ptr; ptr = ptr->parent)
|
||||||
if (ptr->handle == parent) return win->handle;
|
if (ptr->handle == parent) break;
|
||||||
/* otherwise don't return any window, we don't repaint a child before its parent */
|
/* otherwise don't return any window, we don't repaint a child before its parent */
|
||||||
|
if (!ptr) win = NULL;
|
||||||
}
|
}
|
||||||
return 0;
|
if (!win) return 0;
|
||||||
|
win->paint_flags &= ~PAINT_INTERNAL;
|
||||||
|
return win->handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue