Now the service thread is no more in charge of erasing the background

of the Window. Service thread is doing the invalidation part, and the
application thread is doing the erasing part. All this has been
implemented using WM_SYNCPAINT message.
This commit is contained in:
Stephane Lussier 2000-07-28 22:21:19 +00:00 committed by Alexandre Julliard
parent 90c0ccef03
commit 09be9d0d14
2 changed files with 40 additions and 11 deletions

View File

@ -303,6 +303,14 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
return 0; return 0;
} }
case WM_SYNCPAINT:
if (wndPtr->hrgnUpdate)
{
RedrawWindow ( wndPtr->hwndSelf, 0, wndPtr->hrgnUpdate,
RDW_ERASENOW | RDW_ERASE | RDW_FRAME | RDW_ALLCHILDREN );
}
return 0;
case WM_SETREDRAW: case WM_SETREDRAW:
DEFWND_SetRedraw( wndPtr, wParam ); DEFWND_SetRedraw( wndPtr, wParam );
return 0; return 0;

View File

@ -629,18 +629,29 @@ WORD X11DRV_EVENT_XStateToKeyState( int state )
static void EVENT_Expose( HWND hWnd, XExposeEvent *event ) static void EVENT_Expose( HWND hWnd, XExposeEvent *event )
{ {
RECT rect; RECT rect;
int offx = 0,offy = 0;
WND *pWnd = WIN_FindWndPtr(hWnd); WND *pWnd = WIN_FindWndPtr(hWnd);
/* Make position relative to client area instead of window */ /* Make position relative to client area instead of window */
rect.left = event->x - (pWnd? (pWnd->rectClient.left - pWnd->rectWindow.left) : 0); offx = (pWnd? (pWnd->rectClient.left - pWnd->rectWindow.left) : 0);
rect.top = event->y - (pWnd? (pWnd->rectClient.top - pWnd->rectWindow.top) : 0); offy = (pWnd? (pWnd->rectClient.top - pWnd->rectWindow.top) : 0);
rect.left = event->x - offx;
rect.top = event->y - offy;
rect.right = rect.left + event->width; rect.right = rect.left + event->width;
rect.bottom = rect.top + event->height; rect.bottom = rect.top + event->height;
WIN_ReleaseWndPtr(pWnd); WIN_ReleaseWndPtr(pWnd);
Callout.RedrawWindow( hWnd, &rect, 0, Callout.RedrawWindow( hWnd, &rect, 0,
RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN | RDW_ERASE );
(event->count ? 0 : RDW_ERASENOW) );
/* FIXME: We should use SendNotifyMessage here, but this function is not
implemented correctly, so for now we used SendMessage */
/*SendNotifyMessageA(hWnd,WM_SYNCPAINT, 0, 0);*/
if (event->count == 0)
SendMessageA(hWnd,WM_SYNCPAINT, 0, 0);
} }
@ -653,19 +664,29 @@ static void EVENT_Expose( HWND hWnd, XExposeEvent *event )
static void EVENT_GraphicsExpose( HWND hWnd, XGraphicsExposeEvent *event ) static void EVENT_GraphicsExpose( HWND hWnd, XGraphicsExposeEvent *event )
{ {
RECT rect; RECT rect;
WND *pWnd = WIN_FindWndPtr(hWnd); int offx = 0,offy = 0;
WND *pWnd = WIN_FindWndPtr(hWnd);
/* Make position relative to client area instead of window */ /* Make position relative to client area instead of window */
rect.left = event->x - (pWnd? (pWnd->rectClient.left - pWnd->rectWindow.left) : 0); offx = (pWnd? (pWnd->rectClient.left - pWnd->rectWindow.left) : 0);
rect.top = event->y - (pWnd? (pWnd->rectClient.top - pWnd->rectWindow.top) : 0); offy = (pWnd? (pWnd->rectClient.top - pWnd->rectWindow.top) : 0);
rect.left = event->x - offx;
rect.top = event->y - offy;
rect.right = rect.left + event->width; rect.right = rect.left + event->width;
rect.bottom = rect.top + event->height; rect.bottom = rect.top + event->height;
WIN_ReleaseWndPtr(pWnd); WIN_ReleaseWndPtr(pWnd);
Callout.RedrawWindow( hWnd, &rect, 0, Callout.RedrawWindow( hWnd, &rect, 0,
RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_ERASE );
(event->count ? 0 : RDW_ERASENOW) );
/* FIXME: We should use SendNotifyMessage here, but this function is not
implemented correctly, so for now we used SendMessage */
/*SendNotifyMessageA(hWnd,WM_SYNCPAINT, 0, 0);*/
if (event->count == 0)
SendMessageA(hWnd,WM_SYNCPAINT, 0, 0);
} }