]> git.eshelyaron.com Git - emacs.git/commitdiff
(w32_wnd_proc) <WM_PAINT>: Initialize update_rect.
authorJason Rumney <jasonr@gnu.org>
Thu, 24 Jan 2002 20:49:36 +0000 (20:49 +0000)
committerJason Rumney <jasonr@gnu.org>
Thu, 24 Jan 2002 20:49:36 +0000 (20:49 +0000)
Combine the regions returned by BeginPaint and GetUpdateRect.

src/ChangeLog
src/w32fns.c

index 2095530c7ad42146694f6d3730c11b11306e92a2..d34f4602481b1848fb9d55cdc01239924264b4f6 100644 (file)
@@ -1,3 +1,12 @@
+2002-01-24  Jason Rumney  <jasonr@gnu.org>
+
+       * w32term.c (x_scroll_run): Use ScrollWindowEx in place of BitBlt.
+       If region left to draw is not what was expected, mark the frame as
+       garbaged.
+
+       * w32fns.c (w32_wnd_proc) <WM_PAINT>: Initialize update_rect.
+       Combine the regions returned by BeginPaint and GetUpdateRect.
+
 2002-01-23  Jason Rumney  <jasonr@gnu.org>
 
        * w32term.c (x_update_window_begin): Only hide caret if
index beb61281794acb6d8f8d64c140cacc4ca0598dec..38de4b47ef40c68682036e0afc8f9ccaf3cd3755 100644 (file)
@@ -4157,6 +4157,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
       {
        PAINTSTRUCT paintStruct;
         RECT update_rect;
+       bzero (&update_rect, sizeof (update_rect));
 
        f = x_window_to_frame (dpyinfo, hwnd);
        if (f == 0)
@@ -4168,18 +4169,15 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
         /* MSDN Docs say not to call BeginPaint if GetUpdateRect
            fails.  Apparently this can happen under some
            circumstances.  */
-        if (!w32_strict_painting || GetUpdateRect (hwnd, &update_rect, FALSE))
+        if (GetUpdateRect (hwnd, &update_rect, FALSE) || !w32_strict_painting)
           {
             enter_crit ();
             BeginPaint (hwnd, &paintStruct);
 
-           if (w32_strict_painting)
-             /* The rectangles returned by GetUpdateRect and BeginPaint
-                do not always match.  GetUpdateRect seems to be the
-                more reliable of the two.  */
-             wmsg.rect = update_rect;
-           else
-             wmsg.rect = paintStruct.rcPaint;
+           /* The rectangles returned by GetUpdateRect and BeginPaint
+              do not always match.  Play it safe by assuming both areas
+              are invalid.  */
+           UnionRect (&(wmsg.rect), &update_rect, &(paintStruct.rcPaint));
 
 #if defined (W32_DEBUG_DISPLAY)
             DebPrint (("WM_PAINT (frame %p): painting %d,%d-%d,%d\n",