Skip to content

[themes] With --ozone-platform=wayland, the auto-detected color scheme is the opposite color #187280

Closed

Description

@aykevl

Type: Bug

Because I'm running Wayland (not Xorg), I run VSCode using --ozone-platform=wayland (it generally works better on my system than xwayland).

I have enabled the "Auto Detect Color Scheme" setting. However, when I actually change the color scheme, the color scheme of VSCode is the exact opposite as the system color scheme, which is of course not what I want.

Steps to reproduce:

  1. Open VSCode using code --ozone-platform=wayland under KDE Wayland.
  2. Enable "Auto Detect Color Scheme" in the settings.
  3. Run lookandfeeltool -a org.kde.breeze.desktop. This changes the desktop theme to a light color theme, but switches VSCode to a dark color theme.
  4. Run lookandfeeltool -a org.kde.breezedark.desktop. This changes the desktop theme to a dark color theme, but switches VSCode to a light color theme.

The color theme is detected correctly on startup, it's just when the color scheme is changed at runtime it's flipped.

VS Code version: Code - Insiders 1.81.0-insider (31f1832, 2023-07-07T05:32:56.933Z)
OS version: Linux arm64 6.3.0-asahi-10-1-edge-ARCH
Modes:

System Info
Item Value
CPUs unknown (10 x 600)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 3, 2, 2
Memory (System) 30.97GB (21.34GB free)
Process Argv --ozone-platform=wayland --crash-reporter-id 9f93f029-30bf-43aa-954a-09cbacd2d3a2
Screen Reader no
VM 0%
DESKTOP_SESSION plasmawayland
XDG_CURRENT_DESKTOP KDE
XDG_SESSION_DESKTOP KDE
XDG_SESSION_TYPE wayland
Extensions: none
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythontb:30258533
pythonptprofiler:30281269
vshan820:30294714
vscod805cf:30301675
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30404738
py29gd2263:30776702
vsclangdf:30492506
c4g48928:30535728
dsvsc012:30540252
pynewext54:30618038
pylantcb52:30590116
pyind779:30611226
pythonsymbol12:30651887
2i9eh265:30646982
showlangstatbar:30737417
pythonms35:30671666
ecj1e332:30687743
pythonfmttext:30716741
pythoncmvfstr:30726892
fixshowwlkth:30771523
showindicator:30766888
pythongtdpath:30726887
bgfeh915:30780428
gsofa:30778558
pythonnosmt12:30779711
pythonidxpt:30768918
pythondjangots:30768917
pythonnoceb:30776497
copilotsettingt:30767686
e537b577:30772214
h0f32768:30779712
asynctok:30783811
dsvsc013:30777762
dsvsc014:30777825
cmakestatusbarv2:30779594

Activity

  1. changed the title [-]With `--ozone-platform=wayland`, the auto-detected color scheme is the opposite color[/-] [+][themes] With `--ozone-platform=wayland`, the auto-detected color scheme is the opposite color[/+] on Aug 18, 2023
  2. added
    themes
    upstream
    on Aug 18, 2023
  3. aeschli commented on Aug 18, 2023

    @aeschli
    Contributor

    This is an Electron issue. Would you mind filing it there? https://github.com/electron/electron

    Related issue: electron/electron#33635.
    The issue description contains steps to install a small debugging tool that shows what the Electron APIs emit when the OS color schemes is changed.

  4. aykevl commented on Sep 2, 2023

    @aykevl
    Author

    I tried to run that debugging tool but it doesn't change the theme (except the title bar which is expected) and it doesn't print anything to the console when I change the theme. However, when I change the theme in exactly the same way in Code it does change the theme, just in exactly the wrong way (org.kde.breeze.desktop results in a dark Code theme, org.kde.breezedark.desktop results in a light Code theme). Therefore, it appears that VS Code makes use of an API that isn't used by the debugging tool.

    I don't see how I can file a useful Electron bug report with this information.

    Not sure whether it's useful, but here is the output of that debugging tool:

    $ npm start
    
    > [email protected] start
    > electron-forge start
    
    ✔ Checking your system
    ✔ Locating application
    ✔ Loading configuration
    ✔ Preparing native dependencies [0.1s]
    ✔ Running generateAssets hook
    
    shouldUseDarkColors: false, shouldUseHighContrastColors: false, shouldUseInvertedColorScheme: false
    shouldUseDarkColors: false, shouldUseHighContrastColors: false, shouldUseInvertedColorScheme: false
    [4345:0902/114646.431085:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
    [4345:0902/114646.431136:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
    [4345:0902/114646.431157:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
    [4345:0902/114646.431177:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
    [4345:0902/114646.431198:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
    [4345:0902/114646.431216:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
    [4345:0902/114646.431234:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
    [4345:0902/114646.431257:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
    [4345:0902/114646.431546:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
    [4345:0902/114646.431566:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
    [4345:0902/114646.431585:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
    [4345:0902/114646.431604:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
    [4345:0902/114646.431623:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
    [4345:0902/114646.431641:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
    [4345:0902/114646.431660:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
    [4345:0902/114646.431678:ERROR:gbm_wrapper.cc(253)] Failed to export buffer to dma_buf: No such file or directory (2)
    [4345:0902/114648.776262:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
    [4345:0902/114745.265223:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
    [4345:0902/114750.681856:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!
    

    Update: I also checked the new org.freedesktop.appearance property and it works as expected (under KDE):

    # with a dark color scheme
    $ qdbus org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read org.freedesktop.appearance color-scheme
    1
    
    # with a light color scheme
    $ qdbus org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read org.freedesktop.appearance color-scheme
    2
    

    Update 2: checked the latest version of Code but it hasn't changed in behavior. Checked the insiders build but it doesn't seem to change at all after a theme change - this could be an incorrect setting though (it appears to use a separate profile).

  5. locked and limited conversation to collaborators on Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

themesupstream

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions