TabLineSel
Terminal
Title
+TitleBar
+TitleBarNC
TOhtmlProgress
TOhtml-progress-color
ToolbarButton
-*gui_w32.txt* For Vim version 9.1. Last change: 2025 Aug 06
+*gui_w32.txt* For Vim version 9.1. Last change: 2025 Oct 07
VIM REFERENCE MANUAL by Bram Moolenaar
set VIM_KEYCODE_TRANS_STRATEGY=experimental
gvim.exe
<
+
+Title Bar *gui-w32-title-bar*
+
+Starting with Windows 11, you can customize the gVim title bar (also known as
+the caption bar) by enabling the |'go-C'| option.
+
+Once enabled, the appearance is controlled by two highlighting groups:
+1. |hl-TitleBar| -- Sets the color of the title bar for the active window.
+2. |hl-TitleBarNC| -- Sets the color of the title bar for inactive windows.
+
+To use the system's default title bar colors, set highlighting groups to
+`NONE`: >
+
+ hi TitleBar guibg=NONE guifg=NONE
+ hi TitleBarNC guibg=NONE guifg=NONE
+
vim:tw=78:sw=4:ts=8:noet:ft=help:norl:
-*options.txt* For Vim version 9.1. Last change: 2025 Oct 03
+*options.txt* For Vim version 9.1. Last change: 2025 Oct 07
VIM REFERENCE MANUAL by Bram Moolenaar
*'go-c'*
'c' Use console dialogs instead of popup dialogs for simple
choices.
+ *'go-C'*
+ 'C' Use |hl-TitleBar| and |hl-TitleBarNC| if available.
+ Currently only works for MS-Window GUI.
+ See |gui-w32-title-bar| for details.
*'go-d'*
'd' Use dark theme variant if available. Currently only works for
GTK+ GUI.
Terminal |terminal| window (see |terminal-size-color|).
*hl-Title*
Title Titles for output from ":set all", ":autocmd" etc.
+ *hl-TitleBar*
+TitleBar Title bar for the active Gui's window.
+ This feature is supported only in the MS-Windows GUI.
+ See |gui-w32-title-bar| for details
+ Only the `guibg` and `guifg` highlight arguments are effective.
+ *hl-TitleBarNC*
+TitleBarNC Title bar for inactive Gui's window.
+ This feature is supported only in the MS-Windows GUI.
+ See |gui-w32-title-bar| for details
+ Only the `guibg` and `guifg` highlight arguments are effective.
*hl-Visual*
Visual Visual mode selection.
*hl-VisualNOS*
'go' options.txt /*'go'*
'go-!' options.txt /*'go-!'*
'go-A' options.txt /*'go-A'*
+'go-C' options.txt /*'go-C'*
'go-F' options.txt /*'go-F'*
'go-L' options.txt /*'go-L'*
'go-M' options.txt /*'go-M'*
gui-w32-dialogs gui_w32.txt /*gui-w32-dialogs*
gui-w32-printing gui_w32.txt /*gui-w32-printing*
gui-w32-start gui_w32.txt /*gui-w32-start*
+gui-w32-title-bar gui_w32.txt /*gui-w32-title-bar*
gui-w32-various gui_w32.txt /*gui-w32-various*
gui-w32-windowid gui_w32.txt /*gui-w32-windowid*
gui-w32s os_win32.txt /*gui-w32s*
hl-TabPanelSel syntax.txt /*hl-TabPanelSel*
hl-Terminal syntax.txt /*hl-Terminal*
hl-Title syntax.txt /*hl-Title*
+hl-TitleBar syntax.txt /*hl-TitleBar*
+hl-TitleBarNC syntax.txt /*hl-TitleBarNC*
hl-ToolbarButton gui.txt /*hl-ToolbarButton*
hl-ToolbarLine gui.txt /*hl-ToolbarLine*
hl-Tooltip syntax.txt /*hl-Tooltip*
-*version9.txt* For Vim version 9.1. Last change: 2025 Oct 05
+*version9.txt* For Vim version 9.1. Last change: 2025 Oct 07
VIM REFERENCE MANUAL by Bram Moolenaar
- Setting 'nowrap' in a modeline could cause long lines to be hidden
off-screen. To make this visible, the listchars "extend" suboption is set
to ">" by default, indicating text that extends beyond the window width.
+- 'guioptions': New value |'go-C'| to style the title/caption bar on Windows 11
+ (see also the below platform specific change).
Ex commands: ~
- allow to specify a priority when defining a new sign |:sign-define|
Platform specific ~
- MS-Winodws: Paths like "\Windows" and "/Windows" are now considered to be
absolute paths (to the current drive) and no longer relative.
+- MS-Windows: The title bar follows the |hl-TitleBar| and |hl-TitleBarNC|
+ highlighting group |gui-w32-title-bar|.
- macOS: increase default scheduler priority to TASK_DEFAULT_APPLICATION.
Others: ~
|hl-TabPanel| |tabpanel|: not active tab page label
|hl-TabPanelFill| |tabpanel|: filler space
|hl-TabPanelSel| |tabpanel|: active tab page label
+|hl-TitleBarNC| Configure the inactive title/bar on MS-Windows 11
+|hl-TitleBar| Configure the active title/bar on MS-Windows 11
Commands: ~
" Language: Vim script
" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
" Doug Kearns <dougkearns@gmail.com>
-" Last Change: 2025 Sep 27
+" Last Change: 2025 Oct 07
" Former Maintainer: Charles E. Campbell
" DO NOT CHANGE DIRECTLY.
" regular vim commands {{{2
" GEN_SYN_VIM: vimCommand normal, START_STR='syn keyword vimCommand contained', END_STR='nextgroup=vimBang'
-syn keyword vimCommand contained al[l] ar[gs] arga[dd] argd[elete] argdo argded[upe] arge[dit] argg[lobal] argl[ocal] argu[ment] as[cii] b[uffer] bN[ext] ba[ll] bad[d] balt bd[elete] bf[irst] bl[ast] bm[odified] bn[ext] bp[revious] br[ewind] brea[k] breaka[dd] breakd[el] breakl[ist] bro[wse] buffers bufd[o] bun[load] bw[ipeout] c[hange] cN[ext] cNf[ile] cabo[ve] cad[dbuffer] cadde[xpr] caddf[ile] caf[ter] cb[uffer] cbe[fore] cbel[ow] cbo[ttom] cc ccl[ose] cd cdo ce[nter] cex[pr] cf[ile] cfd[o] cfir[st] cg[etfile] cgetb[uffer] cgete[xpr] changes che[ckpath] checkt[ime] chi[story] cl[ist] clip[reset] cla[st] clo[se] cle[arjumps] cn[ext] cnew[er] cnf[ile] col[der] colo[rscheme] com[mand] comc[lear] comp[iler] con[tinue] conf[irm] cons[t] cope[n] cp[revious] cpf[ile] nextgroup=vimBang
-syn keyword vimCommand contained cq[uit] cr[ewind] cs[cope] cst[ag] cw[indow] delm[arks] deb[ug] defc[ompile] di[splay] dif[fupdate] diffg[et] diffo[ff] diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] em[enu] endfo[r] endt[ry] endw[hile] ene[w] ex exi[t] exu[sage] f[ile] files fin[d] fina[lly] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] g[lobal] go[to] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] helpt[ags] ha[rdcopy] hi[ghlight] his[tory] ij[ump] il[ist] int[ro] ip[ut] is[earch] isp[lit] ju[mps] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lan[guage] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] lc[d] lch[dir] nextgroup=vimBang
+syn keyword vimCommand contained al[l] ar[gs] arga[dd] argd[elete] argdo argded[upe] arge[dit] argg[lobal] argl[ocal] argu[ment] as[cii] b[uffer] bN[ext] ba[ll] bad[d] balt bd[elete] bf[irst] bl[ast] bm[odified] bn[ext] bp[revious] br[ewind] brea[k] breaka[dd] breakd[el] breakl[ist] bro[wse] buffers bufd[o] bun[load] bw[ipeout] c[hange] cN[ext] cNf[ile] cabo[ve] cad[dbuffer] cadde[xpr] caddf[ile] caf[ter] cb[uffer] cbe[fore] cbel[ow] cbo[ttom] cc ccl[ose] cd cdo ce[nter] cex[pr] cf[ile] cfd[o] cfir[st] cg[etfile] cgetb[uffer] cgete[xpr] changes che[ckpath] checkt[ime] chi[story] cl[ist] clip[reset] cla[st] clo[se] cle[arjumps] cn[ext] cnew[er] cnf[ile] col[der] colo[rscheme] comc[lear] comp[iler] con[tinue] conf[irm] cons[t] cope[n] cp[revious] cpf[ile] cq[uit] nextgroup=vimBang
+syn keyword vimCommand contained cr[ewind] cs[cope] cst[ag] cw[indow] delm[arks] deb[ug] defc[ompile] di[splay] dif[fupdate] diffg[et] diffo[ff] diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] em[enu] endfo[r] endt[ry] endw[hile] ene[w] ex exi[t] exu[sage] f[ile] files fin[d] fina[lly] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] g[lobal] go[to] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] helpt[ags] ha[rdcopy] hi[ghlight] his[tory] ij[ump] il[ist] int[ro] ip[ut] is[earch] isp[lit] ju[mps] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lan[guage] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] lc[d] lch[dir] nextgroup=vimBang
syn keyword vimCommand contained lcl[ose] lcs[cope] ld[o] le[ft] lex[pr] lf[ile] lfd[o] lfir[st] lg[etfile] lgetb[uffer] lgete[xpr] lgr[ep] lgrepa[dd] lhi[story] ll lla[st] lli[st] lmak[e] lne[xt] lnew[er] lnf[ile] lo[adview] lockv[ar] lol[der] lop[en] lp[revious] lpf[ile] lr[ewind] lt[ag] lw[indow] ls m[ove] marks menut[ranslate] mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] n[ext] nb[key] nbc[lose] nbs[tart] noh[lsearch] nu[mber] o[pen] ol[dfiles] on[ly] opt[ions] ow[nsyntax] p[rint] pa[ckadd] packl[oadall] pb[uffer] pc[lose] ped[it] po[p] pp[op] pre[serve] prev[ious] pro[mptfind] promptr[epl] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] q[uit] quita[ll] qa[ll] r[ead] rec[over] nextgroup=vimBang
syn keyword vimCommand contained red[o] redr[aw] redraws[tatus] redrawt[abline] redrawtabp[anel] reg[isters] res[ize] ret[ab] rew[ind] ri[ght] ru[ntime] rub[y] rubyd[o] rubyf[ile] rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] sav[eas] sb[uffer] sbN[ext] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbp[revious] sbr[ewind] scr[iptnames] scripte[ncoding] scriptv[ersion] scs[cope] setf[iletype] sf[ind] sfir[st] sh[ell] sim[alt] sig[n] sla[st] sn[ext] so[urce] spe[llgood] spelld[ump] spelli[nfo] spellr[epall] spellra[re] spellu[ndo] spellw[rong] spr[evious] sre[wind] st[op] sta[g] star[tinsert] startg[replace] startr[eplace] stopi[nsert] stj[ump] sts[elect] sun[hide] sus[pend] sv[iew] synti[me] sync[bind] smi[le] t tN[ext] ta[g] tags tabc[lose] tabd[o] tabe[dit] nextgroup=vimBang
syn keyword vimCommand contained tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs tc[d] tch[dir] te[aroff] tf[irst] tj[ump] tl[ast] tn[ext] tp[revious] tr[ewind] try ts[elect] u[ndo] undoj[oin] undol[ist] unh[ide] unlo[ckvar] up[date] v[global] ve[rsion] vi[sual] vie[w] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wi[nsize] wind[o] winp[os] wl[restore] wn[ext] wp[revious] wq wqa[ll] wu[ndo] wv[iminfo] x[it] xa[ll] xr[estore] y[ank] z dl dell delel deletl deletel dp dep delp delep deletp deletep a i nextgroup=vimBang
" Default highlighting groups {{{2
" GEN_SYN_VIM: vimHLGroup, START_STR='syn keyword vimHLGroup contained', END_STR=''
-syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText DiffTextAdd PmenuSbar TabLineSel TabLineFill TabPanel TabPanelSel TabPanelFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel PopupSelected MessageWindow PopupNotification PreInsert Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC ToolbarLine ToolbarButton Menu Tooltip Scrollbar
-syn keyword vimHLGroup contained CursorIM ComplMatchIns LineNrAbove LineNrBelow MsgArea Terminal User1 User2 User3 User4 User5 User6 User7 User8 User9
+syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText DiffTextAdd PmenuSbar TabLineSel TabLineFill TabPanel TabPanelSel TabPanelFill Cursor lCursor TitleBar TitleBarNC QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel PopupSelected MessageWindow PopupNotification PreInsert Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC ToolbarLine ToolbarButton
+syn keyword vimHLGroup contained TitleBar TitleBarNC Menu Tooltip Scrollbar CursorIM ComplMatchIns LineNrAbove LineNrBelow MsgArea Terminal User1 User2 User3 User4 User5 User6 User7 User8 User9
syn match vimHLGroup contained "\<Conceal\>"
syn case match
\ end="\ze|"
\ excludenl end="$"
\ nextgroup=vimCmdSep
- \ contains=@vimContinue,@vimExprList,vimComment,vim9Comment
+ \ contains=@vimContinue,@vimExprList,vim9Comment
\ transparent
" Filter: {{{2
#ifdef FEAT_GUI_TABLINE
int using_tabline;
#endif
+#ifdef FEAT_GUI_MSWIN
+ static int prev_titlebar = -1;
+ int using_titlebar = FALSE;
+#endif
#if defined(FEAT_MENU)
static int prev_tearoff = -1;
int using_tearoff = FALSE;
case GO_GREY:
// make menu's have grey items, ignored here
break;
+#ifdef FEAT_GUI_MSWIN
+ case GO_TITLEBAR:
+ using_titlebar = TRUE;
+ break;
+#endif
#ifdef FEAT_TOOLBAR
case GO_TOOLBAR:
using_toolbar = TRUE;
need_set_size = 0;
fix_size = FALSE;
+#ifdef FEAT_GUI_MSWIN
+ if (using_titlebar != prev_titlebar)
+ {
+ gui_mch_set_titlebar_colors();
+ prev_titlebar = using_titlebar;
+ }
+#endif
+
#ifdef FEAT_GUI_DARKTHEME
if (using_dark_theme != prev_dark_theme)
{
gui.in_focus = in_focus;
out_flush_cursor(TRUE, FALSE);
+# ifdef FEAT_GUI_MSWIN
+ gui_mch_set_titlebar_colors();
+# endif
+
# ifdef FEAT_XIM
xim_set_focus(in_focus);
# endif
guicolor_T currFgColor; // Current foreground text color
guicolor_T currBgColor; // Current background text color
guicolor_T currSpColor; // Current special text color
+
+ guicolor_T title_bg_pixel; // window title bar color
+ guicolor_T title_fg_pixel; // window title bar's text color
+ guicolor_T titlenc_bg_pixel; // window title bar color not current
+ guicolor_T titlenc_fg_pixel; // window title bar's text color not current
#endif
#ifdef FEAT_GUI_HAIKU
# define SPI_SETWHEELSCROLLCHARS 0x006D
#endif
+#ifndef DWMWA_CAPTION_COLOR
+# define DWMWA_CAPTION_COLOR 35
+#endif
+
+#ifndef DWMWA_TEXT_COLOR
+# define DWMWA_TEXT_COLOR 36
+#endif
+
#ifdef PROTO
/*
* Define a few things for generating prototypes. This is just to avoid
static DPI_AWARENESS_CONTEXT (WINAPI *pSetThreadDpiAwarenessContext)(DPI_AWARENESS_CONTEXT dpiContext) = NULL;
static DPI_AWARENESS (WINAPI *pGetAwarenessFromDpiAwarenessContext)(DPI_AWARENESS_CONTEXT) = NULL;
+static HINSTANCE hLibDwm = NULL;
+static HRESULT (WINAPI *pDwmSetWindowAttribute)(HWND, DWORD, LPCVOID, DWORD);
+static void dyn_dwm_load(void);
+
static int WINAPI
stubGetSystemMetricsForDpi(int nIndex, UINT dpi UNUSED)
{
}
}
+ static void
+dyn_dwm_load(void)
+{
+ hLibDwm = vimLoadLib("dwmapi.dll");
+ if (hLibDwm == NULL)
+ return;
+
+ pDwmSetWindowAttribute = (HRESULT (WINAPI *)(HWND, DWORD, LPCVOID, DWORD))
+ GetProcAddress(hLibDwm, "DwmSetWindowAttribute");
+
+ if (pDwmSetWindowAttribute == NULL)
+ {
+ FreeLibrary(hLibDwm);
+ hLibDwm = NULL;
+ return;
+ }
+}
+
+extern BOOL win11_or_later; // this is in os_win32.c
+
+/*
+ * Set TitleBar's color. Handle hl-TitleBar and hl-TitleBarNC.
+ *
+ * Only enabled when 'guioptions' has 'C'.
+ * if "TitleBar guibg=NONE guifg=NONE" reset the window back to using the
+ * system's default behavior for the border color.
+ */
+ void
+gui_mch_set_titlebar_colors(void)
+{
+ if (pDwmSetWindowAttribute == NULL || !win11_or_later)
+ return;
+
+ guicolor_T captionColor = 0xFFFFFFFF;
+ guicolor_T textColor = 0xFFFFFFFF;
+
+ if (vim_strchr(p_go, GO_TITLEBAR) != NULL)
+ {
+ if (gui.in_focus)
+ {
+ captionColor = gui.title_bg_pixel;
+ textColor = gui.title_fg_pixel;
+ }
+ else
+ {
+ captionColor = gui.titlenc_bg_pixel;
+ textColor = gui.titlenc_fg_pixel;
+ }
+
+ if (captionColor == INVALCOLOR)
+ captionColor = 0xFFFFFFFF;
+ if (textColor == INVALCOLOR)
+ textColor = 0xFFFFFFFF;
+ }
+
+ pDwmSetWindowAttribute(s_hwnd, DWMWA_CAPTION_COLOR,
+ &captionColor, sizeof(captionColor));
+ pDwmSetWindowAttribute(s_hwnd, DWMWA_TEXT_COLOR,
+ &textColor, sizeof(textColor));
+}
+
/*
* Called when the foreground or background color has been changed.
*/
load_dpi_func();
+ dyn_dwm_load();
+
s_dpi = pGetDpiForSystem();
update_scrollbar_size();
#ifdef FEAT_GUI
"Cursor guibg=fg guifg=bg",
"lCursor guibg=fg guifg=bg", // should be different, but what?
+#endif
+#ifdef FEAT_GUI_MSWIN
+ "TitleBar guibg=bg guifg=fg",
+ "TitleBarNC guibg=NONE guifg=NONE",
#endif
"default link QuickFixLine Search",
"default link CursorLineSign SignColumn",
# if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_X11)
gui_mch_def_colors();
# endif
+# ifdef FEAT_GUI_MSWIN
+ if (gui.in_use)
+ gui_mch_set_titlebar_colors();
+# endif
# ifdef FEAT_GUI_X11
# ifdef FEAT_MENU
int is_menu_group UNUSED,
int is_scrollbar_group UNUSED,
int is_tooltip_group UNUSED,
+ int is_titlebar_group UNUSED,
+ int is_titlebarnc_group UNUSED,
int *do_colors UNUSED,
int init)
{
did_change = TRUE;
}
# if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
+# ifdef FEAT_GUI_MSWIN
+ if (is_titlebar_group && gui.title_fg_pixel != i)
+ {
+ gui.title_fg_pixel = i;
+ *do_colors = TRUE;
+ }
+ if (is_titlebarnc_group && gui.titlenc_fg_pixel != i)
+ {
+ gui.titlenc_fg_pixel = i;
+ *do_colors = TRUE;
+ }
+# endif
# ifdef FEAT_GUI_X11
if (is_menu_group && gui.menu_fg_pixel != i)
{
int is_menu_group UNUSED,
int is_scrollbar_group UNUSED,
int is_tooltip_group UNUSED,
+ int is_titlebar_group UNUSED,
+ int is_titlebarnc_group UNUSED,
int *do_colors UNUSED,
int init)
{
did_change = TRUE;
}
# if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
+# ifdef FEAT_GUI_MSWIN
+ if (is_titlebar_group && gui.title_bg_pixel != i)
+ {
+ gui.title_bg_pixel = i;
+ *do_colors = TRUE;
+ }
+ if (is_titlebarnc_group && gui.titlenc_bg_pixel != i)
+ {
+ gui.titlenc_bg_pixel = i;
+ *do_colors = TRUE;
+ }
+# endif
# ifdef FEAT_GUI_X11
if (is_menu_group && gui.menu_bg_pixel != i)
{
int dolink = FALSE;
int error = FALSE;
int is_normal_group = FALSE; // "Normal" group
+#ifdef FEAT_GUI_MSWIN
+ int is_titlebar_group = FALSE; // "TitleBar" group
+ int is_titlebarnc_group = FALSE; // "TitleBarNC" group
+#else
+# define is_titlebar_group 0
+# define is_titlebarnc_group 0
+#endif
#ifdef FEAT_GUI_X11
int is_menu_group = FALSE; // "Menu" group
int is_scrollbar_group = FALSE; // "Scrollbar" group
if (STRCMP(HL_TABLE()[idx].sg_name_u, "NORMAL") == 0)
is_normal_group = TRUE;
+#ifdef FEAT_GUI_MSWIN
+ else if (STRCMP(HL_TABLE()[idx].sg_name_u, "TITLEBAR") == 0)
+ is_titlebar_group = TRUE;
+ else if (STRCMP(HL_TABLE()[idx].sg_name_u, "TITLEBARNC") == 0)
+ is_titlebarnc_group = TRUE;
+#endif
#ifdef FEAT_GUI_X11
else if (STRCMP(HL_TABLE()[idx].sg_name_u, "MENU") == 0)
is_menu_group = TRUE;
{
#if defined(FEAT_GUI) || defined(FEAT_EVAL)
if (highlight_set_guifg(idx, arg, is_menu_group,
- is_scrollbar_group, is_tooltip_group,
- &do_colors, init))
+ is_scrollbar_group, is_tooltip_group,
+ is_titlebar_group, is_titlebarnc_group,
+ &do_colors, init))
did_change = TRUE;
#endif
}
#if defined(FEAT_GUI) || defined(FEAT_EVAL)
if (highlight_set_guibg(idx, arg, is_menu_group,
is_scrollbar_group, is_tooltip_group,
+ is_titlebar_group, is_titlebarnc_group,
&do_colors, init))
did_change = TRUE;
#endif
control_console_color_rgb();
#endif
}
+#ifdef FEAT_GUI_MSWIN
+ else if (is_titlebar_group)
+ {
+ if (gui.in_use && do_colors)
+ gui_mch_set_titlebar_colors();
+ }
+ else if (is_titlebarnc_group)
+ {
+ if (gui.in_use && do_colors)
+ gui_mch_set_titlebar_colors();
+ }
+#endif
#ifdef FEAT_GUI_X11
# ifdef FEAT_MENU
else if (is_menu_group)
#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) || defined(PROTO)
/*
* Set the normal foreground and background colors according to the "Normal"
- * highlighting group. For X11 also set "Menu", "Scrollbar", and
- * "Tooltip" colors.
+ * highlighting group. For X11 also set "Menu", "Scrollbar" and "Tooltip"
+ * colors. For MS-Windows also set "TitleBar" and "TitleBarNC" colors.
*/
void
set_normal_colors(void)
gui_mch_new_colors();
set_must_redraw(UPD_CLEAR);
}
+# ifdef FEAT_GUI_MSWIN
+ if (set_group_colors((char_u *)"TitleBar",
+ &gui.title_fg_pixel, &gui.title_bg_pixel,
+ FALSE, FALSE, FALSE))
+ {
+ gui_mch_set_titlebar_colors();
+ set_must_redraw(UPD_CLEAR);
+ }
+ if (set_group_colors((char_u *)"TitleBarNC",
+ &gui.titlenc_fg_pixel, &gui.titlenc_bg_pixel,
+ FALSE, FALSE, FALSE))
+ {
+ gui_mch_set_titlebar_colors();
+ set_must_redraw(UPD_CLEAR);
+ }
+# endif
# ifdef FEAT_GUI_X11
if (set_group_colors((char_u *)"Menu",
&gui.menu_fg_pixel, &gui.menu_bg_pixel,
#if defined(FEAT_GUI) || defined(PROTO)
/*
- * Set the colors for "Normal", "Menu", "Tooltip" or "Scrollbar".
+ * Set the colors for "Normal", "Menu", "TitleBar", "TitleBarNC", "Tooltip" or
+ * "Scrollbar".
*/
static int
set_group_colors(
#define GO_ASELML 'A' // autoselect modeless selection
#define GO_BOT 'b' // use bottom scrollbar
#define GO_CONDIALOG 'c' // use console dialog
+#define GO_TITLEBAR 'C' // use 'hl-TitleBar'
#define GO_DARKTHEME 'd' // use dark theme variant
#define GO_TABLINE 'e' // may show tabline
#define GO_FORG 'f' // start GUI in foreground
#define GO_VERTICAL 'v' // arrange dialog buttons vertically
#define GO_KEEPWINSIZE 'k' // keep GUI window size
// all possible flags for 'go'
-#define GO_ALL "!aAbcdefFghilLmMpPrRtTvk"
+#define GO_ALL "!aAbcCdefFghilLmMpPrRtTvk"
// flags for 'comments' option
#define COM_NEST 'n' // comments strings nest
static BOOL win8_or_later = FALSE;
static BOOL win10_22H2_or_later = FALSE;
+BOOL win11_or_later = FALSE; // used in gui_mch_set_titlebar_colors(void)
+
#if !defined(FEAT_GUI_MSWIN) || defined(VIMDLL)
static BOOL use_alternate_screen_buffer = FALSE;
#endif
|| ovi.dwMajorVersion > 10)
win10_22H2_or_later = TRUE;
+ if ((ovi.dwMajorVersion == 10 && ovi.dwBuildNumber >= 22000)
+ || ovi.dwMajorVersion > 10)
+ win11_or_later = TRUE;
+
#ifdef HAVE_ACL
// Enable privilege for getting or setting SACLs.
if (!win32_enable_privilege(SE_SECURITY_NAME))
void gui_mch_set_blinking(long wait, long on, long off);
void gui_mch_stop_blink(int may_call_gui_update_cursor);
void gui_mch_start_blink(void);
+void gui_mch_set_titlebar_colors(void);
void gui_mch_new_colors(void);
void gui_mch_def_colors(void);
int gui_mch_open(void);
set guioptions&
call assert_equal('egmrLtT', &guioptions)
+ set guioptions+=C
+ exec 'sleep' . duration
+ call assert_equal('egmrLtTC', &guioptions)
+ set guioptions-=C
+ exec 'sleep' . duration
+ call assert_equal('egmrLtT', &guioptions)
+
else
" Default Value
set guioptions&
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1834,
/**/
1833,
/**/