-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Remove the gtk-theme extension #1
Comments
Basically the reasoning for this is that elementary apps will only be/depending on the elementary style sheet which should be hardcoded to be the default rather than bringing in all the "theming" machinery of flatpak. |
So, it's needed to install the settings overrides to runtime? But if the user have adwaita has host theme the platform theme get overridden because adwaita comes with the gnome SDK that used to build the platform. |
Yes, for some reason it seems like gtk is trying to set the same stylesheet as the host is running and it doesn't respect gsettings defaults/locks inside the runtime either. I tried to debug this a while ago but it didn't seem to work. diff --git a/defaults.ini b/defaults.ini
new file mode 100644
index 0000000..67b3e6d
--- /dev/null
+++ b/defaults.ini
@@ -0,0 +1,4 @@
+[org.gnome.desktop.interface]
+gtk-theme='elementary'
+icon-theme='elementary'
+cursor-theme='elementary'
diff --git a/io.elementary.Sdk.json.in b/io.elementary.Sdk.json.in
index 20bae57..ce0b776 100644
--- a/io.elementary.Sdk.json.in
+++ b/io.elementary.Sdk.json.in
@@ -6,9 +6,6 @@
"runtime-version": "@GNOME_VERSION@",
"runtime": "org.gnome.Platform",
"sdk": "org.gnome.Sdk",
- "inherit-extensions": [
- "org.gtk.Gtk3theme"
- ],
"sdk-extensions": ["org.gnome.Sdk.Debug", "org.gnome.Sdk.Locale", "org.gnome.Sdk.Docs"],
"platform-extensions": [ "org.gnome.Platform.Locale"],
"finish-args": [
@@ -109,6 +106,19 @@
]
}
]
+ },
+ { "name" : "defaults",
+ "buildsystem" : "simple",
+ "build-commands" : [
+ "mkdir -p /usr/etc/glib-2.0/settings/",
+ "install -m644 -pD defaults.ini /usr/etc/glib-2.0/settings/defaults"
+ ],
+ "sources" : [
+ {
+ "type" : "file",
+ "path" : "defaults.ini"
+ }
+ ]
}
]
} |
The only way that i can lock the theme is passing |
Looking in manifest of appcenters apps in flathub. they define the theme applying a patch inside the app. maybe do the same but only if the theme is not "elementary"? the same can be applied to icons. |
Thinking about this issue lately, flatpak, on X11, uses the selected system xsettings to set the theme, and if the theme don't exist in the sandbox it will use Adwaita (what is the same thing that happens if the same occurs in the system). One solution can be patching Gtk to if they can't find the selected theme, define the gschema defined default and, if it don't exist, define Adwaita. Another solution can be use the |
Gave this another try using gschema overrides this time. diff --git defaults.ini defaults.ini
new file mode 100644
index 0000000..67b3e6d
--- /dev/null
+++ defaults.ini
@@ -0,0 +1,4 @@
+[org.gnome.desktop.interface]
+gtk-theme='elementary'
+icon-theme='elementary'
+cursor-theme='elementary'
diff --git io.elementary.Sdk.json.in io.elementary.Sdk.json.in
index 8a9abdd..be815fc 100644
--- io.elementary.Sdk.json.in
+++ io.elementary.Sdk.json.in
@@ -119,6 +119,20 @@
]
}
]
+ },
+ { "name" : "defaults",
+ "buildsystem" : "simple",
+ "build-commands" : [
+ "mkdir -p /usr/share/glib-2.0/schemas/",
+ "install -m644 -pD defaults.ini /usr/share/glib-2.0/schemas/org.gnome.desktop.interface.gschema.override",
+ "glib-compile-schemas /usr/share/glib-2.0/schemas/"
+ ],
+ "sources" : [
+ {
+ "type" : "file",
+ "path" : "defaults.ini"
+ }
+ ]
}
]
} This works as expected when invoking gsettings from the cli, but when launching the app and going through the portal it seems like the Settings portal takes precedence over it or overrides it. This results in inheriting the host
Given that we ain't going to get a stylesheet api on gtk itself anytime soon it might be fine to move all the stylesheet code to Granite Application or such. On ElementaryOS its going to inherit the host theme name and be able to use the color variants, and if it doesn't much it could default to hardcoding the default elementary stylesheet. (Should also hardcode the icon theme to be elementary regardless as we don't seem to have a way to fix that, unless we patch gtk in the runtime). |
I'm told we should delete this
flatpak-platform/io.elementary.Sdk.json.in
Lines 9 to 11 in da803d9
according to @alatiera
The text was updated successfully, but these errors were encountered: