Patch 8.1.2301

34 views
Skip to first unread message

Bram Moolenaar

unread,
Nov 15, 2019, 4:44:24 PM11/15/19
to vim...@googlegroups.com

Patch 8.1.2301
Problem: MS-Windows GUI: drawing error when background color changes.
Solution: Implement gui_mch_new_colors(). (Simon Sadler)
Files: src/gui_w32.c


*** ../vim-8.1.2300/src/gui_w32.c 2019-11-05 21:09:18.629946582 +0100
--- src/gui_w32.c 2019-11-14 22:10:20.944659014 +0100
***************
*** 325,331 ****
#endif
HWND s_hwnd = NULL;
static HDC s_hdc = NULL;
! static HBRUSH s_brush = NULL;

#ifdef FEAT_TOOLBAR
static HWND s_toolbarhwnd = NULL;
--- 325,331 ----
#endif
HWND s_hwnd = NULL;
static HDC s_hdc = NULL;
! static HBRUSH s_brush = NULL;

#ifdef FEAT_TOOLBAR
static HWND s_toolbarhwnd = NULL;
***************
*** 1282,1288 ****
void
gui_mch_new_colors(void)
{
! /* nothing to do? */
}

/*
--- 1282,1299 ----
void
gui_mch_new_colors(void)
{
! 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);
}

/*
*** ../vim-8.1.2300/src/version.c 2019-11-13 22:35:15.759521804 +0100
--- src/version.c 2019-11-15 22:40:40.432124459 +0100
***************
*** 743,744 ****
--- 743,746 ----
{ /* Add new patch number below this line */
+ /**/
+ 2301,
/**/

--
From "know your smileys":
:-O>-o Smiley American tourist (note big mouth and camera)

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

John Marriott

unread,
Nov 16, 2019, 2:06:39 PM11/16/19
to vim...@googlegroups.com

On 16-Nov-2019 08:44, Bram Moolenaar wrote:
> Patch 8.1.2301
> Problem: MS-Windows GUI: drawing error when background color changes.
> Solution: Implement gui_mch_new_colors(). (Simon Sadler)
> Files: src/gui_w32.c
>
Before this patch, my toolbar looked like this:


After this patch, my toolbar has turned black. It doesn't seem to matter
what colour scheme I use.



How can I change it back?
Cheers
John

John Marriott

unread,
Nov 16, 2019, 2:23:15 PM11/16/19
to vim...@googlegroups.com
I lost the pictures, so let's try again.

Before:


After:

Simon Sadler

unread,
Nov 16, 2019, 3:29:02 PM11/16/19
to vim_dev
On Saturday, 16 November 2019 19:06:39 UTC, John Marriott wrote:

On 16-Nov-2019 08:44, Bram Moolenaar wrote:
> Patch 8.1.2301
> Problem:    MS-Windows GUI: drawing error when background color changes.
> Solution:   Implement gui_mch_new_colors(). (Simon Sadler)
> Files:            src/gui_w32.c
>
After this patch, my toolbar has turned black. It doesn't seem to matter
what colour scheme I use.

I checked the code. The toolbar is set to transparent so the now filled background shows through. I'll look into a fix.


S.

John Marriott

unread,
Nov 16, 2019, 3:34:29 PM11/16/19
to vim...@googlegroups.com

On 17-Nov-2019 07:29, 'Simon Sadler' via vim_dev wrote:
> On Saturday, 16 November 2019 19:06:39 UTC, John Marriott wrote:
>
>
> On 16-Nov-2019 08:44, Bram Moolenaar wrote:
> > Patch 8.1.2301
> > Problem:    MS-Windows GUI: drawing error when background
> color changes.
> > Solution:   Implement gui_mch_new_colors(). (Simon Sadler)
> > Files:            src/gui_w32.c
> >
> After this patch, my toolbar has turned black. It doesn't seem to
> matter
> what colour scheme I use.
>
>
> I checked the code. The toolbar is set to transparent so the now
> filled background shows through. I'll look into a fix.
>
>
> S.
>
That would be great thanks.
Cheers
John

Simon

unread,
Nov 16, 2019, 6:06:44 PM11/16/19
to John Marriott, vim...@googlegroups.com
John Marriott wrote:

> On 17-Nov-2019 07:29, 'Simon Sadler' via vim_dev wrote:
>> On Saturday, 16 November 2019 19:06:39 UTC, John Marriott wrote:
>>
>>
>> On 16-Nov-2019 08:44, Bram Moolenaar wrote:
>> > Patch 8.1.2301
>> > Problem: MS-Windows GUI: drawing error when background
>> color changes.
>> > Solution: Implement gui_mch_new_colors(). (Simon Sadler)
>> > Files: src/gui_w32.c
>> >
>> After this patch, my toolbar has turned black. It doesn't seem to
>> matter
>> what colour scheme I use.
>>
>>
>> I checked the code. The toolbar is set to transparent so the now
>> filled background shows through. I'll look into a fix.
> That would be great thanks.

Hey John. I have a fix. Would you be willing to test?

--
S.

John Marriott

unread,
Nov 16, 2019, 6:46:24 PM11/16/19
to vim...@googlegroups.com
Yes no problem
Reply all
Reply to author
Forward
0 new messages