Skip to content

Commit ab85ca4

Browse files
committed
patch 8.1.2301: MS-Windows GUI: drawing error when background color changes
Problem: MS-Windows GUI: drawing error when background color changes. Solution: Implement gui_mch_new_colors(). (Simon Sadler)
1 parent 1ebbb6e commit ab85ca4

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

src/gui_w32.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ static
325325
#endif
326326
HWND s_hwnd = NULL;
327327
static HDC s_hdc = NULL;
328-
static HBRUSH s_brush = NULL;
328+
static HBRUSH s_brush = NULL;
329329

330330
#ifdef FEAT_TOOLBAR
331331
static HWND s_toolbarhwnd = NULL;
@@ -1282,7 +1282,18 @@ vim_WindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
12821282
void
12831283
gui_mch_new_colors(void)
12841284
{
1285-
/* nothing to do? */
1285+
HBRUSH prevBrush;
1286+
1287+
s_brush = CreateSolidBrush(gui.back_pixel);
1288+
#ifdef SetClassLongPtr
1289+
prevBrush = (HBRUSH)SetClassLongPtr(
1290+
s_hwnd, GCLP_HBRBACKGROUND, (LONG_PTR)s_brush);
1291+
#else
1292+
prevBrush = (HBRUSH)SetClassLong(
1293+
s_hwnd, GCL_HBRBACKGROUND, (long_u)s_brush);
1294+
#endif
1295+
InvalidateRect(s_hwnd, NULL, TRUE);
1296+
DeleteObject(prevBrush);
12861297
}
12871298

12881299
/*

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
2301,
744746
/**/
745747
2300,
746748
/**/

0 commit comments

Comments
 (0)