From c0611964e99c94240abcc9bac34f472c8e0fbbbf Mon Sep 17 00:00:00 2001 From: Andrew Innes Date: Wed, 5 May 1999 11:18:31 +0000 Subject: [PATCH] (w32_strict_painting): New variable. (w32_wnd_proc): Use it to select repaint rules. (syms_of_w32fns): Defvar it. --- src/w32fns.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/w32fns.c b/src/w32fns.c index 00e2011a12..c2e1fd318e 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -146,6 +146,10 @@ Lisp_Object Vw32_system_coding_system; /* A flag to control whether fonts are matched strictly or not. */ int w32_strict_fontnames; +/* A flag to control whether we should only repaint if GetUpdateRect + indicates there is an update region. */ +int w32_strict_painting; + /* Evaluate this expression to rebuild the section of syms_of_w32fns that initializes and staticpros the symbols declared below. Note that Emacs 18 has a bug that keeps C-x C-e from being able to @@ -3723,15 +3727,18 @@ 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 (GetUpdateRect (hwnd, &update_rect, FALSE)) + if (!w32_strict_painting || GetUpdateRect (hwnd, &update_rect, FALSE)) { enter_crit (); BeginPaint (hwnd, &paintStruct); - /* 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; + 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; #if defined (W32_DEBUG_DISPLAY) DebPrint (("WM_PAINT: painting %d,%d-%d,%d\n", wmsg.rect.left, @@ -3747,7 +3754,12 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) return 0; } - return 1; + + /* If GetUpdateRect returns 0 (meaning there is no update + region), assume the whole window needs to be repainted. */ + GetClientRect(hwnd, &wmsg.rect); + my_post_msg (&wmsg, hwnd, msg, wParam, lParam); + return 0; } case WM_INPUTLANGCHANGE: @@ -7529,6 +7541,13 @@ Setting this to t will prevent wrong fonts being selected when\n\ fontsets are automatically created."); w32_strict_fontnames = 0; + DEFVAR_BOOL ("w32-strict-painting", + &w32_strict_painting, + "Non-nil means use strict rules for repainting frames.\n\ +Set this to nil to get the old behaviour for repainting; this should\n\ +only be necessary if the default setting causes problems."); + w32_strict_painting = 1; + DEFVAR_LISP ("w32-system-coding-system", &Vw32_system_coding_system, "Coding system used by Windows system functions, such as for font names."); -- 2.39.2