4157 |
{ |
{ |
4158 |
PAINTSTRUCT paintStruct; |
PAINTSTRUCT paintStruct; |
4159 |
RECT update_rect; |
RECT update_rect; |
4160 |
|
bzero (&update_rect, sizeof (update_rect)); |
4161 |
|
|
4162 |
f = x_window_to_frame (dpyinfo, hwnd); |
f = x_window_to_frame (dpyinfo, hwnd); |
4163 |
if (f == 0) |
if (f == 0) |
4169 |
/* MSDN Docs say not to call BeginPaint if GetUpdateRect |
/* MSDN Docs say not to call BeginPaint if GetUpdateRect |
4170 |
fails. Apparently this can happen under some |
fails. Apparently this can happen under some |
4171 |
circumstances. */ |
circumstances. */ |
4172 |
if (!w32_strict_painting || GetUpdateRect (hwnd, &update_rect, FALSE)) |
if (GetUpdateRect (hwnd, &update_rect, FALSE) || !w32_strict_painting) |
4173 |
{ |
{ |
4174 |
enter_crit (); |
enter_crit (); |
4175 |
BeginPaint (hwnd, &paintStruct); |
BeginPaint (hwnd, &paintStruct); |
4176 |
|
|
4177 |
if (w32_strict_painting) |
/* The rectangles returned by GetUpdateRect and BeginPaint |
4178 |
/* The rectangles returned by GetUpdateRect and BeginPaint |
do not always match. Play it safe by assuming both areas |
4179 |
do not always match. GetUpdateRect seems to be the |
are invalid. */ |
4180 |
more reliable of the two. */ |
UnionRect (&(wmsg.rect), &update_rect, &(paintStruct.rcPaint)); |
|
wmsg.rect = update_rect; |
|
|
else |
|
|
wmsg.rect = paintStruct.rcPaint; |
|
4181 |
|
|
4182 |
#if defined (W32_DEBUG_DISPLAY) |
#if defined (W32_DEBUG_DISPLAY) |
4183 |
DebPrint (("WM_PAINT (frame %p): painting %d,%d-%d,%d\n", |
DebPrint (("WM_PAINT (frame %p): painting %d,%d-%d,%d\n", |