aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/w32fns.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index 00e2011a12a..c2e1fd318ee 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -146,6 +146,10 @@ Lisp_Object Vw32_system_coding_system;
146/* A flag to control whether fonts are matched strictly or not. */ 146/* A flag to control whether fonts are matched strictly or not. */
147int w32_strict_fontnames; 147int w32_strict_fontnames;
148 148
149/* A flag to control whether we should only repaint if GetUpdateRect
150 indicates there is an update region. */
151int w32_strict_painting;
152
149/* Evaluate this expression to rebuild the section of syms_of_w32fns 153/* Evaluate this expression to rebuild the section of syms_of_w32fns
150 that initializes and staticpros the symbols declared below. Note 154 that initializes and staticpros the symbols declared below. Note
151 that Emacs 18 has a bug that keeps C-x C-e from being able to 155 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)
3723 /* MSDN Docs say not to call BeginPaint if GetUpdateRect 3727 /* MSDN Docs say not to call BeginPaint if GetUpdateRect
3724 fails. Apparently this can happen under some 3728 fails. Apparently this can happen under some
3725 circumstances. */ 3729 circumstances. */
3726 if (GetUpdateRect (hwnd, &update_rect, FALSE)) 3730 if (!w32_strict_painting || GetUpdateRect (hwnd, &update_rect, FALSE))
3727 { 3731 {
3728 enter_crit (); 3732 enter_crit ();
3729 BeginPaint (hwnd, &paintStruct); 3733 BeginPaint (hwnd, &paintStruct);
3730 3734
3731 /* The rectangles returned by GetUpdateRect and BeginPaint 3735 if (w32_strict_painting)
3732 do not always match. GetUpdateRect seems to be the 3736 /* The rectangles returned by GetUpdateRect and BeginPaint
3733 more reliable of the two. */ 3737 do not always match. GetUpdateRect seems to be the
3734 wmsg.rect = update_rect; 3738 more reliable of the two. */
3739 wmsg.rect = update_rect;
3740 else
3741 wmsg.rect = paintStruct.rcPaint;
3735 3742
3736#if defined (W32_DEBUG_DISPLAY) 3743#if defined (W32_DEBUG_DISPLAY)
3737 DebPrint (("WM_PAINT: painting %d,%d-%d,%d\n", wmsg.rect.left, 3744 DebPrint (("WM_PAINT: painting %d,%d-%d,%d\n", wmsg.rect.left,
@@ -3747,7 +3754,12 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
3747 3754
3748 return 0; 3755 return 0;
3749 } 3756 }
3750 return 1; 3757
3758 /* If GetUpdateRect returns 0 (meaning there is no update
3759 region), assume the whole window needs to be repainted. */
3760 GetClientRect(hwnd, &wmsg.rect);
3761 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
3762 return 0;
3751 } 3763 }
3752 3764
3753 case WM_INPUTLANGCHANGE: 3765 case WM_INPUTLANGCHANGE:
@@ -7529,6 +7541,13 @@ Setting this to t will prevent wrong fonts being selected when\n\
7529fontsets are automatically created."); 7541fontsets are automatically created.");
7530 w32_strict_fontnames = 0; 7542 w32_strict_fontnames = 0;
7531 7543
7544 DEFVAR_BOOL ("w32-strict-painting",
7545 &w32_strict_painting,
7546 "Non-nil means use strict rules for repainting frames.\n\
7547Set this to nil to get the old behaviour for repainting; this should\n\
7548only be necessary if the default setting causes problems.");
7549 w32_strict_painting = 1;
7550
7532 DEFVAR_LISP ("w32-system-coding-system", 7551 DEFVAR_LISP ("w32-system-coding-system",
7533 &Vw32_system_coding_system, 7552 &Vw32_system_coding_system,
7534 "Coding system used by Windows system functions, such as for font names."); 7553 "Coding system used by Windows system functions, such as for font names.");