Skip to content
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

Native Windows title bar does not respect dark mode setting #84453

Closed
MolusMS opened this issue Nov 11, 2019 · 21 comments · Fixed by #137241 or #143223
Closed

Native Windows title bar does not respect dark mode setting #84453

MolusMS opened this issue Nov 11, 2019 · 21 comments · Fixed by #137241 or #143223
Assignees
Labels
chromium Issues and items related to Chromium confirmed Issue has been confirmed by VS Code Team member electron Issues and items related to Electron electron-16-update Issues related to electron 16 update feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders titlebar VS Code main title bar issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-fixed The underlying upstream issue has been fixed upstream-issue-linked This is an upstream issue that has been reported upstream verification-needed Verification of issue is requested verified Verification succeeded windows VS Code on Windows issues
Milestone

Comments

@MolusMS
Copy link

MolusMS commented Nov 11, 2019

Issue Type: Bug

I have the dark theme on VSCode, if I set the window.titleBarStyle to native, the title bar does not pick up the dark color.

VS Code version: Code - Insiders 1.41.0-insider (27cd33d, 2019-11-08T19:12:35.358Z)
OS version: Windows_NT x64 10.0.19514

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (16 x 3600)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 63.81GB (51.88GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (3)
Extension Author (truncated) Version
vscode-nmake-tools Mic 2.0.191107007
cpptools ms- 0.26.1
powershell-preview ms- 2019.11.0
@vscodebot
Copy link

vscodebot bot commented Nov 11, 2019

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@sbatten
Copy link
Member

sbatten commented Nov 11, 2019

@deepak1556, this is really an electron feature request

@deepak1556
Copy link
Collaborator

deepak1556 commented Nov 12, 2019

@sbatten electron fixed this in 7 and also exposed a new module to allow apps customize it electron/electron#19656

@deepak1556
Copy link
Collaborator

@MolusMS can you try the exploration builds from #84214 (comment) to make sure this is fixed with electron 7. Thanks!

@deepak1556 deepak1556 added electron Issues and items related to Electron info-needed Issue requires more information from poster labels Nov 14, 2019
@vscodebot vscodebot bot closed this as completed Nov 25, 2019
@vscodebot
Copy link

vscodebot bot commented Nov 25, 2019

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@deepak1556 deepak1556 reopened this Nov 25, 2019
@deepak1556
Copy link
Collaborator

Verified that this is not fixed in electron 7, we would have to listen to OS events using the above module and set the app color.

@deepak1556 deepak1556 added confirmed Issue has been confirmed by VS Code Team member titlebar VS Code main title bar issues windows VS Code on Windows issues and removed info-needed Issue requires more information from poster labels Nov 27, 2019
@deepak1556
Copy link
Collaborator

After some investigation, this is a bug in chrome as well, launch chrome with --disable-windows10-custom-titlebar and the native title bar will not respect the dark mode for apps settings. Should be reported in upstream.

@deepak1556 deepak1556 added chromium Issues and items related to Chromium upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Dec 13, 2019
@LarsFosdal
Copy link

This goes for the light theme as well. The app does not use the Windows 10 Theme App Title colors for focused / non-focused.
Really annoying!

@Poopooracoocoo
Copy link

cough undocumented APIs for dark titlebars cough

@rzhao271
Copy link
Contributor

Adding upstream Chromium issue link https://bugs.chromium.org/p/chromium/issues/detail?id=1127795

@rzhao271 rzhao271 added the upstream-issue-linked This is an upstream issue that has been reported upstream label Oct 21, 2021
@rzhao271 rzhao271 added this to the November 2021 milestone Oct 29, 2021
@rzhao271
Copy link
Contributor

rzhao271 commented Nov 2, 2021

I tried setting some breakpoints and noticed that https://source.chromium.org/chromium/chromium/src/+/main:ui/views/window/non_client_view.cc;l=113;bpv=1;bpt=1 gets hit. But, I didn't find a corresponding OnPaint event handler. https://source.chromium.org/chromium/chromium/src/+/main:ui/views/window/custom_frame_view.cc;drc=cafa646efbb6f668d3ba20ff482c1f729159ae97;bpv=0;bpt=1;l=363 is the closest we get, but it's for the custom frame view rather than the native one.

I then noticed that other non-Chromium Windows app titlebars weren't picking up the system colour either, so I looked around and saw microsoft/microsoft-ui-xaml#2484, which still hasn't been implemented.

@rzhao271 rzhao271 added the feature-request Request for new features or functionality label Nov 3, 2021
@rzhao271
Copy link
Contributor

rzhao271 commented Nov 4, 2021

I just realized that the original issue is saying that if the user picks a dark mode theme, then the native titlebar colour should also be the dark mode colour. I'm not as sure about this. On macOS, for example, the native titlebar colour goes by the OS theme, and same with cmd.exe on Windows. Changing the issue scope so that we're going by OS theme instead.

@rzhao271 rzhao271 changed the title Window Title Bar Style = native does not respect dark theme settings Native Windows title bar does not respect dark mode setting Nov 4, 2021
@rzhao271 rzhao271 modified the milestones: January 2022, February 2022 Jan 11, 2022
@Tyriar Tyriar added the verification-needed Verification of issue is requested label Feb 23, 2022
@joyceerhl joyceerhl added the verified Verification succeeded label Feb 23, 2022
@joyceerhl
Copy link
Contributor

Still seems to repro in latest Insiders which uses Electron 16:

image

@joyceerhl joyceerhl reopened this Feb 23, 2022
@joyceerhl joyceerhl added verification-found Issue verification failed and removed verified Verification succeeded labels Feb 23, 2022
@rzhao271
Copy link
Contributor

rzhao271 commented Feb 23, 2022

Looks like I forgot to add steps.

  1. On Windows, set the app mode (or if not available, the system mode/theme) to dark mode.
  2. Set VS Code to use the native titlebar.
  3. The titlebar should be black rather than white. More specifically, it should be the same colour as the titlebar you get when opening a command prompt from the start menu.

@rzhao271 rzhao271 removed the verification-found Issue verification failed label Feb 23, 2022
@joyceerhl joyceerhl added the verified Verification succeeded label Feb 23, 2022
@joyceerhl
Copy link
Contributor

  1. System theme is dark mode
    image
  2. VS Code is configured to use native titlebar with the "window.titleBarStyle": "native" setting
  3. Title bar is still white

After also changing my app mode to dark mode, the title bar is black. Is that expected @rzhao271?

image

@rzhao271
Copy link
Contributor

Reopening since we're switching back Electron versions.

@rzhao271 rzhao271 reopened this Feb 24, 2022
@deepak1556 deepak1556 modified the milestones: February 2022, March 2022 Feb 24, 2022
@rzhao271 rzhao271 removed the verified Verification succeeded label Mar 1, 2022
@rzhao271
Copy link
Contributor

Verification steps:
See #84453 (comment).

@hediet hediet added the verified Verification succeeded label Mar 23, 2022
@be9em0t
Copy link

be9em0t commented Apr 18, 2022

From my point of view, native titlebar does respect theme color EVENTUALLY.

During VS Code launch first empty un-themed window appears (looks like un-themed (basic theme) windows 10, light blue titlebar which really cuts your eyes when in dark mode ).
Then, once all components finish loading, the titlebar is repainted with the correct theme.

Short clip

image

@rzhao271
Copy link
Contributor

That's a separate issue: #146683

@github-actions github-actions bot locked and limited conversation to collaborators Apr 24, 2022
@bpasero bpasero moved this to ✔️ Done / Deferred in VSCode Electron Integration Jul 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
chromium Issues and items related to Chromium confirmed Issue has been confirmed by VS Code Team member electron Issues and items related to Electron electron-16-update Issues related to electron 16 update feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders titlebar VS Code main title bar issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-fixed The underlying upstream issue has been fixed upstream-issue-linked This is an upstream issue that has been reported upstream verification-needed Verification of issue is requested verified Verification succeeded windows VS Code on Windows issues
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

12 participants