4101 |
{ |
{ |
4102 |
PAINTSTRUCT paintStruct; |
PAINTSTRUCT paintStruct; |
4103 |
RECT update_rect; |
RECT update_rect; |
4104 |
|
bzero (&update_rect, sizeof (update_rect)); |
4105 |
|
|
4106 |
f = x_window_to_frame (dpyinfo, hwnd); |
f = x_window_to_frame (dpyinfo, hwnd); |
4107 |
if (f == 0) |
if (f == 0) |
4113 |
/* MSDN Docs say not to call BeginPaint if GetUpdateRect |
/* MSDN Docs say not to call BeginPaint if GetUpdateRect |
4114 |
fails. Apparently this can happen under some |
fails. Apparently this can happen under some |
4115 |
circumstances. */ |
circumstances. */ |
4116 |
if (!w32_strict_painting || GetUpdateRect (hwnd, &update_rect, FALSE)) |
if (GetUpdateRect (hwnd, &update_rect, FALSE) || !w32_strict_painting) |
4117 |
{ |
{ |
4118 |
enter_crit (); |
enter_crit (); |
4119 |
BeginPaint (hwnd, &paintStruct); |
BeginPaint (hwnd, &paintStruct); |
4120 |
|
|
4121 |
if (w32_strict_painting) |
/* The rectangles returned by GetUpdateRect and BeginPaint |
4122 |
/* The rectangles returned by GetUpdateRect and BeginPaint |
do not always match. Play it safe by assuming both areas |
4123 |
do not always match. GetUpdateRect seems to be the |
are invalid. */ |
4124 |
more reliable of the two. */ |
UnionRect (&(wmsg.rect), &update_rect, &(paintStruct.rcPaint)); |
|
wmsg.rect = update_rect; |
|
|
else |
|
|
wmsg.rect = paintStruct.rcPaint; |
|
4125 |
|
|
4126 |
#if defined (W32_DEBUG_DISPLAY) |
#if defined (W32_DEBUG_DISPLAY) |
4127 |
DebPrint (("WM_PAINT (frame %p): painting %d,%d-%d,%d\n", |
DebPrint (("WM_PAINT (frame %p): painting %d,%d-%d,%d\n", |