]> git.eshelyaron.com Git - emacs.git/commitdiff
(w32_read_socket): Determine clipping rectangle for
authorAndrew Innes <andrewi@gnu.org>
Wed, 17 Oct 2001 17:19:27 +0000 (17:19 +0000)
committerAndrew Innes <andrewi@gnu.org>
Wed, 17 Oct 2001 17:19:27 +0000 (17:19 +0000)
the entire frame, including areas covered by scrollbars and the
menubar.  This avoids internal arguments about whether a frame is
fully obscured or not.

src/ChangeLog
src/w32term.c

index cfb787536875511ddfdd854dd0b3b0534d593d43..e27fbf476663e9d04cdeec86f6f61b15d5390c97 100644 (file)
@@ -1,3 +1,10 @@
+2001-10-17  Andrew Innes  <andrewi@gnu.org>
+
+       * w32term.c (w32_read_socket): Determine clipping rectangle for
+       the entire frame, including areas covered by scrollbars and the
+       menubar.  This avoids internal arguments about whether a frame is
+       fully obscured or not.
+
 2001-10-17  Gerd Moellmann  <gerd@gnu.org>
 
        * xdisp.c (try_window_id): Undo last change.  Give up if
index 8478f6c8b5e84ae2994ca1c58b3b157a8c171fa6..0425ed445775a3911a6e9046ab6fdb20a1f7df6b 100644 (file)
@@ -8713,9 +8713,19 @@ w32_read_socket (sd, bufp, numchars, expected)
          if (FRAME_W32_P (f) && f->async_visible)
            {
              RECT clipbox;
-             HDC  hdc = get_frame_dc (f);
+             HDC  hdc;
+
+             enter_crit ();
+             /* Query clipping rectangle for the entire window area
+                 (GetWindowDC), not just the client portion (GetDC).
+                 Otherwise, the scrollbars and menubar aren't counted as
+                 part of the visible area of the frame, and we may think
+                 the frame is obscured when really a scrollbar is still
+                 visible and gets WM_PAINT messages above.  */
+             hdc = GetWindowDC (FRAME_W32_WINDOW (f));
              GetClipBox (hdc, &clipbox);
-             release_frame_dc (f, hdc);
+             ReleaseDC (FRAME_W32_WINDOW (f), hdc);
+             leave_crit ();
 
              if (clipbox.right == clipbox.left
                  || clipbox.bottom == clipbox.top)