-
Notifications
You must be signed in to change notification settings - Fork 3.5k
feat: add Linux system title bar setting option #12040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add a setting in Display Settings that allows Linux users to switch between custom title bar (frameless window with WindowControls) and native system title bar. The setting requires app restart to take effect since Electron's frame option cannot be changed at runtime. - Add useSystemTitleBar config key and getter/setter in ConfigManager - Add IPC channel and handler for setting persistence - Add Redux state and action for useSystemTitleBar - Add UI toggle in DisplaySettings (Linux only) - Hide WindowControls when system title bar is enabled on Linux - Modify WindowService to check setting when creating window on Linux - Add translations for all supported locales 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Move WindowControls inside NavbarContainer as a flex item instead of using fixed positioning. This ensures the window controls are properly positioned adjacent to the navbar content when using the left navbar layout. - Remove position: fixed from WindowControlsContainer styling - Include WindowControls as last child of NavbarContainer - Remove extra padding-right from NavbarRight since controls are now in the flex layout 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new setting option for Linux users to enable the system title bar instead of the custom frameless window with custom controls. The feature requires an app restart to take effect and is platform-specific (Linux only).
Key changes:
- Added
useSystemTitleBarRedux state with default value offalse - Integrated a new UI toggle in Display Settings (Linux only) with restart confirmation dialog
- Modified window creation logic to conditionally use native frames on Linux based on the setting
- Adjusted WindowControls component positioning from fixed to inline flow layout
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/renderer/src/store/settings.ts | Added useSystemTitleBar state, action, and initialization |
| src/renderer/src/pages/settings/DisplaySettings/DisplaySettings.tsx | Added UI toggle for the system title bar setting with restart confirmation |
| src/renderer/src/pages/home/Navbar.tsx | Simplified paddingRight to static value since WindowControls are no longer fixed positioned |
| src/renderer/src/i18n/translate/*.json | Added translations with placeholder text for non-English locales |
| src/renderer/src/i18n/locales/zh-cn.json | Added Chinese translations for the new setting |
| src/renderer/src/i18n/locales/en-us.json | Added English translations for the new setting |
| src/renderer/src/hooks/useSettings.ts | Added setUseSystemTitleBar hook function |
| src/renderer/src/components/app/Navbar.tsx | Moved WindowControls from fixed positioning to inline, removed conditional rendering based on navbar position |
| src/renderer/src/components/WindowControls/index.tsx | Added logic to hide controls when using system title bar on Linux |
| src/renderer/src/components/WindowControls/WindowControls.styled.ts | Removed fixed positioning styles, converted to inline flex layout |
| src/renderer/src/components/Tab/TabContainer.tsx | Added conditional padding for Windows/Linux to accommodate WindowControls |
| src/preload/index.ts | Added IPC bridge for setUseSystemTitleBar |
| src/main/services/WindowService.ts | Modified window creation to conditionally use native frame on Linux |
| src/main/services/ConfigManager.ts | Added getter/setter methods for useSystemTitleBar config |
| src/main/ipc.ts | Added IPC handler for setting the useSystemTitleBar value |
| packages/shared/IpcChannel.ts | Added App_SetUseSystemTitleBar IPC channel |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| flex: activeTopicOrSession === 'topic' ? 1 : 'none', | ||
| position: 'relative', | ||
| paddingRight: isWin || isLinux ? '144px' : '15px', | ||
| paddingRight: '8px', |
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The paddingRight is now hardcoded to '8px' for all platforms, but this might not provide enough space for the WindowControls on Windows and Linux when the system title bar is not being used. Consider making this conditional based on the platform and useSystemTitleBar setting to ensure proper spacing for the window controls.
| paddingRight: '8px', | |
| paddingRight: | |
| typeof navigator !== 'undefined' && /Windows|Win32|Linux/i.test(navigator.userAgent) | |
| ? '80px' | |
| : '8px', |
| gap: 5px; | ||
| padding-left: ${({ $isFullscreen }) => (!$isFullscreen && isMac ? 'calc(env(titlebar-area-x) + 4px)' : '15px')}; | ||
| padding-right: ${({ $isFullscreen }) => ($isFullscreen ? '12px' : '0')}; | ||
| padding-right: ${({ $isFullscreen }) => ($isFullscreen ? '12px' : isWin || isLinux ? '8px' : '0')}; |
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The paddingRight for TabsBar includes hardcoded values for Linux ('8px') when not in fullscreen mode. This padding should be conditional based on whether the system title bar is being used on Linux. When useSystemTitleBar is true on Linux, the custom window controls won't be displayed (they return null), so the padding calculation might need adjustment. Consider making the padding conditional to match whether WindowControls will actually be rendered.
| padding-right: ${({ $isFullscreen }) => ($isFullscreen ? '12px' : isWin || isLinux ? '8px' : '0')}; | |
| padding-right: ${({ $isFullscreen }) => ($isFullscreen ? '12px' : isWin ? '8px' : '0')}; |
Remove the 8px padding-right for Windows/Linux in TabsBar that was causing window controls to not be flush against the window edge. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
| flex: activeTopicOrSession === 'topic' ? 1 : 'none', | ||
| position: 'relative', | ||
| paddingRight: isWin || isLinux ? '144px' : '15px', | ||
| paddingRight: '8px', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note
This issue/comment/review was translated by Claude.
Why was this changed?
Original Content
这里为啥要改
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note
This comment was translated by Claude.
- WindowControls positioning has changed
Previously (main branch):
position: fixed;
top: 0;
right: 0;The window control buttons were fixed in the top-right corner of the window, so Navbar.tsx needed paddingRight: 144px to prevent content from being obscured.
Currently (feature branch):
/* Removed fixed positioning */
display: flex;The window control buttons have become flex children, directly placed inside the NavbarContainer.
- Navbar structure has also changed
Previously: WindowControls was outside the NavbarContainer, using fixed positioning
Currently: WindowControls is inside the NavbarContainer, naturally arranged as flex children
Conclusion
So paddingRight: '8px' is correct! Because:
- The window control buttons are now part of the flex layout and will automatically take up space
- No need to manually reserve 144px of space anymore
- Both Windows and Linux use the same flex layout approach
However, I've unified it to use 15px as before, which has been corrected.
Original Content
- WindowControls 定位方式改变了
之前(main 分支):
position: fixed;
top: 0;
right: 0;
窗口控制按钮是固定定位在窗口右上角的,所以 Navbar.tsx 需要 paddingRight: 144px 来避免内容被遮挡。
现在(feature 分支):
/* 移除了 fixed 定位 */
display: flex;
窗口控制按钮变成了 flex 子元素,直接放在 NavbarContainer 里面。
- Navbar 结构也改变了
之前:WindowControls 在 NavbarContainer 外面,使用 fixed 定位
现在:WindowControls 在 NavbarContainer 里面,作为 flex 子元素自然排列
结论
所以 paddingRight: '8px' 是正确的!因为:
- 窗口控制按钮现在是 flex 布局的一部分,会自动占据空间
- 不再需要手动预留 144px 的空间
- Windows 和 Linux 都使用同样的 flex 布局方式
不过还是和之前统一下使用15 px, 已经修正了。
Co-Authored-By: Claude Opus 4.5 <[email protected]>


fix #5574 (comment)