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

[Feature Request] Set GTK UIs to dark theme when xdg-desktop-portal prefer dark/light setting is used #38961

Closed
3 tasks done
RushingAlien opened this issue Jul 1, 2023 · 1 comment · Fixed by #38977
Closed
3 tasks done

Comments

@RushingAlien
Copy link

RushingAlien commented Jul 1, 2023

Preflight Checklist

Problem Description

With chromium 114, xdg-desktop-portal becomes a supported way of setting dark theme. This setting is just a preference(The setting does not set a dark GTK theme by itself) and the task of setting a the appropriate light/dark theme based on the preference lies entirely on the app/library/framework.

Currently, chromium's implementation with GTK UI does not do this, where the setting only affects prefers-color-scheme media query and not GTK UIs. So, the task of setting the appropriate GTK theme to GTK UIs will lie on electron.

Why is this important

  • Wayland CSD : on GNOME Wayland, electron's CSD will be used, which is GTK
  • FIle chooser dialogue : On Linux, electron uses the GTK file chooser
  • Native prompt dialogue : Electron's native prompt dialouge is GTK

Proposed Solution

Set a dark GTK theme to be used in electron when xdg-desktop-portal prefer-dark setting is used
Likewise when prefer-light is use
there is also the "no prefernce" setting to keep in mind

Alternatives Considered

For this issue to be handled upstream in chromium

Additional Information

GTK themes have a dark variant if the theme's folder has a gtk-dark.css file.

Also where this works currently :

  • Firefox
  • Libreoffice
  • libhandy apps
robertgzr added a commit to robertgzr/electron that referenced this issue Jul 3, 2023
This is needed after https://bugs.chromium.org/p/chromium/issues/detail?id=998903
and replaces the previous workaround to detect dark mode on GTK.
Detect system dark theme preference via xdg settings portal:
https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings

Closes: electron#38961
Signed-off-by: Robert Günzler <r@gnzler.io>
robertgzr added a commit to robertgzr/electron that referenced this issue Jul 3, 2023
This is needed after https://bugs.chromium.org/p/chromium/issues/detail?id=998903
and replaces the previous workaround to detect dark mode on GTK.
Detect system dark theme preference via xdg settings portal:
https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings

Closes: electron#38961
Signed-off-by: Robert Günzler <r@gnzler.io>
@Igetin
Copy link

Igetin commented Jul 7, 2023

This is a duplicate of #33635 (which was falsely closed a few months ago).

robertgzr added a commit to robertgzr/electron that referenced this issue Jul 14, 2023
This is needed after https://bugs.chromium.org/p/chromium/issues/detail?id=998903
and replaces the previous workaround to detect dark mode on GTK.
Detect system dark theme preference via xdg settings portal:
https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings

Closes: electron#38961
Closes: electron#28838
Signed-off-by: Robert Günzler <r@gnzler.io>
robertgzr added a commit to robertgzr/electron that referenced this issue Jul 20, 2023
This is needed after https://bugs.chromium.org/p/chromium/issues/detail?id=998903
and replaces the previous workaround to detect dark mode on GTK.
Detect system dark theme preference via xdg settings portal:
https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings

Closes: electron#38961
Closes: electron#28838
Signed-off-by: Robert Günzler <r@gnzler.io>
jkleinsc added a commit that referenced this issue Sep 27, 2023
feat: port DarkModeManagerLinux

This is needed after https://bugs.chromium.org/p/chromium/issues/detail?id=998903
and replaces the previous workaround to detect dark mode on GTK.
Detect system dark theme preference via xdg settings portal:
https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings

Closes: #38961
Closes: #28838

Signed-off-by: Robert Günzler <r@gnzler.io>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
trop bot added a commit that referenced this issue Sep 27, 2023
feat: port DarkModeManagerLinux

This is needed after https://bugs.chromium.org/p/chromium/issues/detail?id=998903
and replaces the previous workaround to detect dark mode on GTK.
Detect system dark theme preference via xdg settings portal:
https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings

Closes: #38961
Closes: #28838

Signed-off-by: Robert Günzler <r@gnzler.io>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

Co-authored-by: Robert Günzler <r@gnzler.io>
trop bot added a commit that referenced this issue Sep 27, 2023
feat: port DarkModeManagerLinux

This is needed after https://bugs.chromium.org/p/chromium/issues/detail?id=998903
and replaces the previous workaround to detect dark mode on GTK.
Detect system dark theme preference via xdg settings portal:
https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings

Closes: #38961
Closes: #28838

Signed-off-by: Robert Günzler <r@gnzler.io>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

Co-authored-by: Robert Günzler <r@gnzler.io>
trop bot added a commit that referenced this issue Sep 27, 2023
feat: port DarkModeManagerLinux

This is needed after https://bugs.chromium.org/p/chromium/issues/detail?id=998903
and replaces the previous workaround to detect dark mode on GTK.
Detect system dark theme preference via xdg settings portal:
https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings

Closes: #38961
Closes: #28838

Signed-off-by: Robert Günzler <r@gnzler.io>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

Co-authored-by: Robert Günzler <r@gnzler.io>
trop bot added a commit that referenced this issue Sep 27, 2023
feat: port DarkModeManagerLinux

This is needed after https://bugs.chromium.org/p/chromium/issues/detail?id=998903
and replaces the previous workaround to detect dark mode on GTK.
Detect system dark theme preference via xdg settings portal:
https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings

Closes: #38961
Closes: #28838

Signed-off-by: Robert Günzler <r@gnzler.io>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

Co-authored-by: Robert Günzler <r@gnzler.io>
jkleinsc pushed a commit that referenced this issue Sep 27, 2023
feat: port DarkModeManagerLinux

This is needed after https://bugs.chromium.org/p/chromium/issues/detail?id=998903
and replaces the previous workaround to detect dark mode on GTK.
Detect system dark theme preference via xdg settings portal:
https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings

Closes: #38961
Closes: #28838

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Robert Günzler <r@gnzler.io>
jkleinsc pushed a commit that referenced this issue Sep 27, 2023
feat: port DarkModeManagerLinux

This is needed after https://bugs.chromium.org/p/chromium/issues/detail?id=998903
and replaces the previous workaround to detect dark mode on GTK.
Detect system dark theme preference via xdg settings portal:
https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings

Closes: #38961
Closes: #28838

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Robert Günzler <r@gnzler.io>
codebytere pushed a commit that referenced this issue Sep 28, 2023
feat: port DarkModeManagerLinux

This is needed after https://bugs.chromium.org/p/chromium/issues/detail?id=998903
and replaces the previous workaround to detect dark mode on GTK.
Detect system dark theme preference via xdg settings portal:
https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings

Closes: #38961
Closes: #28838

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Robert Günzler <r@gnzler.io>
MrHuangJser pushed a commit to MrHuangJser/electron that referenced this issue Dec 11, 2023
feat: port DarkModeManagerLinux

This is needed after https://bugs.chromium.org/p/chromium/issues/detail?id=998903
and replaces the previous workaround to detect dark mode on GTK.
Detect system dark theme preference via xdg settings portal:
https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings

Closes: electron#38961
Closes: electron#28838

Signed-off-by: Robert Günzler <r@gnzler.io>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants