From 238170a0184b9be88117520fd97851662570a5af Mon Sep 17 00:00:00 2001 From: Andrew Innes Date: Wed, 17 Oct 2001 17:22:37 +0000 Subject: [PATCH] (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. --- src/ChangeLog | 7 +++++++ src/w32term.c | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index fba800fff72..30d8548780f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2001-10-17 Andrew Innes + + * 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 * xdisp.c (try_window_id): Undo last change. Give up if diff --git a/src/w32term.c b/src/w32term.c index 201a5331515..e8af4c53e3e 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -8719,9 +8719,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) -- 2.39.2