Ken Takata wrote:
> 2019/11/15 Fri 6:36:36 UTC+9 Bram Moolenaar wrote: > > > > Simon wrote: > > > > > Attached is a patch to solve a long-standing issue in gVim when > > > using dark backgrounds. e.g. > > > > > > https://github.com/vim/vim/issues/349 > > > https://www.reddit.com/r/vim/search/?q=gvim%20borders&restrict_sr=1 > > > > > > * This mini patch automatically changes the main window to the > > > background colour thus eliminating white-space to the right and bottom > > > edge - it looks great > > > > > > * I have utilised the static s_brush so it will always contain the > > > main window background brush just as before > > > > > > * The previous brush is deleted after being replaced by the new one > > > > > > * I have checked for memory leaks > > > > > > > > > Thanks for everything. :) > > > > The other use of SetClassLongPtr() is inside an #ifdef. > > I suppose for older compilers. > > How about this: > > > > 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); > > } > > > > I don't remember when SetClassLongPtr() was added. At least, VC 2008 has > it, and VC 6 doesn't have it. > We already dropped support for Windows 9x, so I don't think we need to keep > support old compilers > which support Win9x. I think we can drop support for VC 2005 or older. > How about always using SetClassLongPtr()? Well, using one solution in one place and another elsewhere isn't nice. Let me keep the #ifdef in this patch, we can make another patch to simplify the code by dropping support for old compilers. We still aim at supporting Windows XP, not sure what the minimal compiler is. I'm using MSVC 2015 and haven't heard that the binaries don't work somewhere. It's a free download, thus perhaps we can use this one as the minimum? -- >From "know your smileys": O:-) Saint /// Bram Moolenaar -- [email protected] -- 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 /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/201911152144.xAFLiDB1023882%40masaka.moolenaar.net.
