Skip to content

Commit

Permalink
Normalize the default GTK theme
Browse files Browse the repository at this point in the history
  • Loading branch information
jiri-janousek committed Feb 12, 2020
1 parent bed2896 commit 74287ed
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/gtk/DesktopShell.vala
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ using Drt;
namespace Drtgtk {

const string THEME_ADWAITA = "Adwaita";
const string THEME_ADWAITA_DARK = "Adwaita-dark";

public abstract class DesktopShell: GLib.Object {
private static DesktopShell? default_shell = null;
private static GenericSet<string> shells = null;
Expand Down Expand Up @@ -83,7 +85,12 @@ public abstract class DesktopShell: GLib.Object {
*/
public static string get_gtk_theme() {
string? theme = Gtk.Settings.get_default().gtk_theme_name;
return theme != "" ? theme : "Adwaita";
if (theme == "" || theme == THEME_ADWAITA_DARK) {
// Normalize the default theme or dark theme preference won't work.
theme = THEME_ADWAITA;
set_gtk_theme(theme);
}
return theme;
}

/**
Expand Down

0 comments on commit 74287ed

Please sign in to comment.