From 18f0b3428088385e9cc14fc0dee7525ba397a0b0 Mon Sep 17 00:00:00 2001 From: Andrew Innes Date: Tue, 4 Sep 2001 17:35:24 +0000 Subject: [PATCH] (w32_createwindow): Remove the WS_CLIPCHILDREN style from Emacs frames, so that calls to GetClipBox in w32term.c correctly report when part of a frame is visible (including scrollbars, etc). This prevents repeated redrawing of frames when only a scrollbar is visible. (w32_wnd_proc): Add more frame information to debugging output. --- src/w32fns.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/w32fns.c b/src/w32fns.c index 113305ccc95..054d477cee8 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -3351,7 +3351,7 @@ w32_createwindow (f) FRAME_W32_WINDOW (f) = hwnd = CreateWindow (EMACS_CLASS, f->namebuf, - f->output_data.w32->dwStyle | WS_CLIPCHILDREN, + f->output_data.w32->dwStyle, f->output_data.w32->left_pos, f->output_data.w32->top_pos, rect.right - rect.left, @@ -4062,9 +4062,10 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) release_frame_dc (f, hdc); #if defined (W32_DEBUG_DISPLAY) - DebPrint (("WM_ERASEBKGND: erasing %d,%d-%d,%d\n", - wmsg.rect.left, wmsg.rect.top, wmsg.rect.right, - wmsg.rect.bottom)); + DebPrint (("WM_ERASEBKGND (frame %p): erasing %d,%d-%d,%d\n", + f, + wmsg.rect.left, wmsg.rect.top, + wmsg.rect.right, wmsg.rect.bottom)); #endif /* W32_DEBUG_DISPLAY */ } return 1; @@ -4084,6 +4085,13 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) PAINTSTRUCT paintStruct; RECT update_rect; + f = x_window_to_frame (dpyinfo, hwnd); + if (f == 0) + { + DebPrint (("WM_PAINT received for unknown window %p\n", hwnd)); + return 0; + } + /* MSDN Docs say not to call BeginPaint if GetUpdateRect fails. Apparently this can happen under some circumstances. */ @@ -4101,9 +4109,11 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) wmsg.rect = paintStruct.rcPaint; #if defined (W32_DEBUG_DISPLAY) - DebPrint (("WM_PAINT: painting %d,%d-%d,%d\n", wmsg.rect.left, - wmsg.rect.top, wmsg.rect.right, wmsg.rect.bottom)); - DebPrint (("WM_PAINT: update region is %d,%d-%d,%d\n", + DebPrint (("WM_PAINT (frame %p): painting %d,%d-%d,%d\n", + f, + wmsg.rect.left, wmsg.rect.top, + wmsg.rect.right, wmsg.rect.bottom)); + DebPrint ((" [update region is %d,%d-%d,%d]\n", update_rect.left, update_rect.top, update_rect.right, update_rect.bottom)); #endif -- 2.39.2