From 8847d8908b75492c0701b1421b097515972198af Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 16 Apr 1996 21:49:18 +0000 Subject: [PATCH] (defined_color): Map color to nearest in default palette. (win32_wnd_proc): Special handling for WM_CLOSE. --- src/w32fns.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/w32fns.c b/src/w32fns.c index b321f92fe45..38f09bbf852 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -1185,7 +1185,9 @@ defined_color (f, color, color_def, alloc) if (!NILP (tem)) { - *color_def = XUINT (tem); + /* map color to nearest in (default) palette, to avoid + dithering on limited color displays. */ + *color_def = XUINT (tem) | 0x2000000; return 1; } else @@ -2777,12 +2779,16 @@ win32_wnd_proc (hwnd, msg, wParam, lParam) case WM_MOVE: case WM_SIZE: case WM_KILLFOCUS: - case WM_CLOSE: case WM_VSCROLL: case WM_SYSCOMMAND: case WM_COMMAND: my_post_msg (&wmsg, hwnd, msg, wParam, lParam); goto dflt; + + case WM_CLOSE: + my_post_msg (&wmsg, hwnd, msg, wParam, lParam); + return 0; + case WM_WINDOWPOSCHANGING: { WINDOWPLACEMENT wp; -- 2.39.2