Skip to content

Commit 3b3cb04

Browse files
committed
patch 9.1.1830: MS-Windows: Dark mode titlebar is not configurable
Problem: MS-Windows: Dark mode titlebar is not configurable (after v9.1.1813) Solution: Revert patch v9.1.1813 Revert "patch 9.1.1813: MS-Windows: title bar is always white" This reverts commit dddde9c. related: #18282 Signed-off-by: Christian Brabandt <[email protected]>
1 parent b73ccf7 commit 3b3cb04

File tree

6 files changed

+5
-62
lines changed

6 files changed

+5
-62
lines changed

runtime/doc/gui_w32.txt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*gui_w32.txt* For Vim version 9.1. Last change: 2025 Sep 29
1+
*gui_w32.txt* For Vim version 9.1. Last change: 2025 Aug 06
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -488,12 +488,4 @@ VIM_KEYCODE_TRANS_STRATEGY can be set to the desired value ("experimental" or
488488
set VIM_KEYCODE_TRANS_STRATEGY=experimental
489489
gvim.exe
490490
<
491-
492-
Title Bar's Behaviour *gui-w32-title-bar-behaviour*
493-
494-
The color of the gVim title bar (sometimes also called the caption bar) is
495-
treated as part of the application's background. Starting with Windows 11,
496-
it follows the background color defined by |hl-Normal|, so it matches the
497-
background of the current colorscheme.
498-
499491
vim:tw=78:sw=4:ts=8:noet:ft=help:norl:

runtime/doc/tags

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8223,7 +8223,6 @@ gui-w32-cmdargs gui_w32.txt /*gui-w32-cmdargs*
82238223
gui-w32-dialogs gui_w32.txt /*gui-w32-dialogs*
82248224
gui-w32-printing gui_w32.txt /*gui-w32-printing*
82258225
gui-w32-start gui_w32.txt /*gui-w32-start*
8226-
gui-w32-title-bar-behaviour gui_w32.txt /*gui-w32-title-bar-behaviour*
82278226
gui-w32-various gui_w32.txt /*gui-w32-various*
82288227
gui-w32-windowid gui_w32.txt /*gui-w32-windowid*
82298228
gui-w32s os_win32.txt /*gui-w32s*

runtime/doc/version9.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41750,8 +41750,6 @@ Plugins~
4175041750
Platform specific ~
4175141751
- MS-Winodws: Paths like "\Windows" and "/Windows" are now considered to be
4175241752
absolute paths (to the current drive) and no longer relative.
41753-
- MS-Windows: The title bar background follows the |hl-Normal| highlighting
41754-
group background color.
4175541753
- macOS: increase default scheduler priority to TASK_DEFAULT_APPLICATION.
4175641754

4175741755
Others: ~

src/gui_w32.c

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -318,14 +318,6 @@ gui_mch_set_rendering_options(char_u *s)
318318
# define SPI_SETWHEELSCROLLCHARS 0x006D
319319
#endif
320320

321-
#ifndef DWMWA_CAPTION_COLOR
322-
# define DWMWA_CAPTION_COLOR 35
323-
#endif
324-
325-
#ifndef DWMWA_TEXT_COLOR
326-
# define DWMWA_TEXT_COLOR 36
327-
#endif
328-
329321
#ifdef PROTO
330322
/*
331323
* Define a few things for generating prototypes. This is just to avoid
@@ -476,9 +468,6 @@ static int (WINAPI *pGetSystemMetricsForDpi)(int, UINT) = NULL;
476468
static DPI_AWARENESS_CONTEXT (WINAPI *pSetThreadDpiAwarenessContext)(DPI_AWARENESS_CONTEXT dpiContext) = NULL;
477469
static DPI_AWARENESS (WINAPI *pGetAwarenessFromDpiAwarenessContext)(DPI_AWARENESS_CONTEXT) = NULL;
478470

479-
// Sets the value of Desktop Window Manager (DWM) non-client rendering attributes for a window.
480-
static HRESULT (WINAPI *pDwmSetWindowAttribute)(HWND, DWORD, LPCVOID, DWORD) = NULL;
481-
482471
static int WINAPI
483472
stubGetSystemMetricsForDpi(int nIndex, UINT dpi UNUSED)
484473
{
@@ -1602,20 +1591,6 @@ _TextAreaWndProc(
16021591
}
16031592
}
16041593

1605-
static void
1606-
load_dwm_func(void)
1607-
{
1608-
static HMODULE hLibDwm = NULL;
1609-
hLibDwm = vimLoadLib("dwmapi.dll");
1610-
if (hLibDwm == NULL)
1611-
return;
1612-
1613-
pDwmSetWindowAttribute = (HRESULT (WINAPI *)(HWND, DWORD, LPCVOID, DWORD))
1614-
GetProcAddress(hLibDwm, "DwmSetWindowAttribute");
1615-
}
1616-
1617-
extern BOOL win11_or_later; // this is in os_win32.c
1618-
16191594
/*
16201595
* Called when the foreground or background color has been changed.
16211596
*/
@@ -1629,21 +1604,6 @@ gui_mch_new_colors(void)
16291604
s_hwnd, GCLP_HBRBACKGROUND, (LONG_PTR)s_brush);
16301605
InvalidateRect(s_hwnd, NULL, TRUE);
16311606
DeleteObject(prevBrush);
1632-
1633-
// Set The Caption Bar
1634-
1635-
if (pDwmSetWindowAttribute == NULL)
1636-
return;
1637-
1638-
if (win11_or_later)
1639-
{
1640-
const COLORREF captionColor = gui.back_pixel;
1641-
pDwmSetWindowAttribute(s_hwnd, DWMWA_CAPTION_COLOR,
1642-
&captionColor, sizeof(captionColor));
1643-
const COLORREF textColor = gui.norm_pixel;
1644-
pDwmSetWindowAttribute(s_hwnd, DWMWA_TEXT_COLOR,
1645-
&textColor, sizeof(textColor));
1646-
}
16471607
}
16481608

16491609
/*
@@ -5676,8 +5636,6 @@ gui_mch_init(void)
56765636

56775637
load_dpi_func();
56785638

5679-
load_dwm_func();
5680-
56815639
s_dpi = pGetDpiForSystem();
56825640
update_scrollbar_size();
56835641

src/os_win32.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,8 @@ static int suppress_winsize = 1; // don't fiddle with console
222222

223223
static WCHAR *exe_pathw = NULL;
224224

225-
BOOL win8_or_later = FALSE;
226-
BOOL win10_22H2_or_later = FALSE;
227-
BOOL win11_or_later = FALSE;
228-
225+
static BOOL win8_or_later = FALSE;
226+
static BOOL win10_22H2_or_later = FALSE;
229227
#if !defined(FEAT_GUI_MSWIN) || defined(VIMDLL)
230228
static BOOL use_alternate_screen_buffer = FALSE;
231229
#endif
@@ -1012,10 +1010,6 @@ PlatformId(void)
10121010
|| ovi.dwMajorVersion > 10)
10131011
win10_22H2_or_later = TRUE;
10141012

1015-
if ((ovi.dwMajorVersion == 10 && ovi.dwBuildNumber >= 22000)
1016-
|| ovi.dwMajorVersion > 10)
1017-
win11_or_later = TRUE;
1018-
10191013
#ifdef HAVE_ACL
10201014
// Enable privilege for getting or setting SACLs.
10211015
if (!win32_enable_privilege(SE_SECURITY_NAME))

src/version.c

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

730730
static int included_patches[] =
731731
{ /* Add new patch number below this line */
732+
/**/
733+
1830,
732734
/**/
733735
1829,
734736
/**/

0 commit comments

Comments
 (0)