vim-patch:9.1.1834: MS-Windows: not possible to highlight the title bar

Problem:  MS-Windows: not possible to highlight the title bar
Solution: Make the title/caption bar configurable by introducing the
          'go-C' option value which allows to highlight it using the
          TitleBar and TitleBarNC highlighting groups (Mao-Yining).

Introduce titlebar color customization for Windows 11 GUI through
highlight groups and new 'guioptions' flag:

- Add 'C' flag to enable titlebar color customization (opt-in)
- New highlight groups: TitleBar (active) and TitleBarNC (inactive)
- Uses DWMWA_CAPTION_COLOR and DWMWA_TEXT_COLOR DWM attributes
- Dynamically loads dwmapi.dll for Windows 11 compatibility
- Defaults to system colors when set to NONE or feature disabled

closes: vim/vim#18449

2c09368273

Co-authored-by: Mao-Yining <mao.yining@outlook.com>
This commit is contained in:
zeertzjq
2025-10-09 07:07:19 +08:00
parent 0ea46563eb
commit e47529ab56
2 changed files with 4 additions and 3 deletions

View File

@@ -106,7 +106,7 @@ syn keyword vimGroup contained Added Bold BoldItalic Boolean Changed Character C
syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit DiffText DiffTextAdd PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel 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 syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit DiffText DiffTextAdd PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel 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
syn keyword vimHLGroup contained CursorIM ComplMatchIns LineNrAbove LineNrBelow MsgArea User1 User2 User3 User4 User5 User6 User7 User8 User9 syn keyword vimHLGroup contained CursorIM ComplMatchIns LineNrAbove LineNrBelow MsgArea User1 User2 User3 User4 User5 User6 User7 User8 User9
syn match vimHLGroup contained "\<Conceal\>" syn match vimHLGroup contained "\<Conceal\>"
syn keyword vimOnlyHLGroup contained Menu PopupSelected MessageWindow PopupNotification Scrollbar Terminal ToolbarButton ToolbarLine Tooltip VisualNOS syn keyword vimOnlyHLGroup contained Menu PopupSelected MessageWindow PopupNotification Scrollbar Terminal TitleBar TitleBarNC ToolbarButton ToolbarLine Tooltip VisualNOS
syn keyword nvimHLGroup contained FloatBorder FloatFooter FloatTitle MsgSeparator NormalFloat NormalNC Substitute TermCursor VisualNC Whitespace WinBar WinBarNC WinSeparator syn keyword nvimHLGroup contained FloatBorder FloatFooter FloatTitle MsgSeparator NormalFloat NormalNC Substitute TermCursor VisualNC Whitespace WinBar WinBarNC WinSeparator
"}}}2 "}}}2
syn case match syn case match
@@ -1300,7 +1300,7 @@ syn region vimEval
\ end="\ze|" \ end="\ze|"
\ excludenl end="$" \ excludenl end="$"
\ nextgroup=vimCmdSep \ nextgroup=vimCmdSep
\ contains=@vimContinue,@vimExprList,vimComment,vim9Comment \ contains=@vimContinue,@vimExprList,vim9Comment
\ transparent \ transparent
" Filter: {{{2 " Filter: {{{2

View File

@@ -178,6 +178,7 @@ enum {
#define GO_ASELML 'A' // autoselect modeless selection #define GO_ASELML 'A' // autoselect modeless selection
#define GO_BOT 'b' // use bottom scrollbar #define GO_BOT 'b' // use bottom scrollbar
#define GO_CONDIALOG 'c' // use console dialog #define GO_CONDIALOG 'c' // use console dialog
#define GO_TITLEBAR 'C' // use 'hl-TitleBar'
#define GO_DARKTHEME 'd' // use dark theme variant #define GO_DARKTHEME 'd' // use dark theme variant
#define GO_TABLINE 'e' // may show tabline #define GO_TABLINE 'e' // may show tabline
#define GO_FORG 'f' // start GUI in foreground #define GO_FORG 'f' // start GUI in foreground
@@ -196,7 +197,7 @@ enum {
#define GO_FOOTER 'F' // add footer #define GO_FOOTER 'F' // add footer
#define GO_VERTICAL 'v' // arrange dialog buttons vertically #define GO_VERTICAL 'v' // arrange dialog buttons vertically
#define GO_KEEPWINSIZE 'k' // keep GUI window size #define GO_KEEPWINSIZE 'k' // keep GUI window size
#define GO_ALL "!aAbcdefFghilLmMpPrRtTvk" // all possible flags for 'go' #define GO_ALL "!aAbcCdefFghilLmMpPrRtTvk" // all possible flags for 'go'
// flags for 'comments' option // flags for 'comments' option
#define COM_NEST 'n' // comments strings nest #define COM_NEST 'n' // comments strings nest