summaryrefslogtreecommitdiffstats
path: root/src/gui_w32.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-15 22:41:14 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-15 22:41:14 +0100
commitab85ca4e6a40b2998db7b00896505486f5c16b41 (patch)
tree30235a09964946f92d5036f7e3c409518304e7e2 /src/gui_w32.c
parent1ebbb6ee452dfca89335ac75f07c3db133b56645 (diff)
patch 8.1.2301: MS-Windows GUI: drawing error when background color changesv8.1.2301
Problem: MS-Windows GUI: drawing error when background color changes. Solution: Implement gui_mch_new_colors(). (Simon Sadler)
Diffstat (limited to 'src/gui_w32.c')
-rw-r--r--src/gui_w32.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gui_w32.c b/src/gui_w32.c
index 02d2e096b5..3dbbc5eec0 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -325,7 +325,7 @@ static
#endif
HWND s_hwnd = NULL;
static HDC s_hdc = NULL;
-static HBRUSH s_brush = NULL;
+static HBRUSH s_brush = NULL;
#ifdef FEAT_TOOLBAR
static HWND s_toolbarhwnd = NULL;
@@ -1282,7 +1282,18 @@ vim_WindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
void
gui_mch_new_colors(void)
{
- /* nothing to do? */
+ HBRUSH prevBrush;
+
+ s_brush = CreateSolidBrush(gui.back_pixel);
+#ifdef SetClassLongPtr
+ prevBrush = (HBRUSH)SetClassLongPtr(
+ s_hwnd, GCLP_HBRBACKGROUND, (LONG_PTR)s_brush);
+#else
+ prevBrush = (HBRUSH)SetClassLong(
+ s_hwnd, GCL_HBRBACKGROUND, (long_u)s_brush);
+#endif
+ InvalidateRect(s_hwnd, NULL, TRUE);
+ DeleteObject(prevBrush);
}
/*