[gnome-software/wip/mcrha/css-absolute-url] Misc: Use absolute URL in CSS
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/mcrha/css-absolute-url] Misc: Use absolute URL in CSS
- Date: Mon, 1 Nov 2021 09:01:19 +0000 (UTC)
commit 4ce749cecf9ef544d2047758b093ed0c0efad89e
Author: Milan Crha <mcrha redhat com>
Date: Mon Nov 1 09:59:08 2021 +0100
Misc: Use absolute URL in CSS
The gtk4 stopped interpreting relative URL-s, thus use an absolute URL,
including the scheme, in the CSS.
Related to https://gitlab.gnome.org/GNOME/gtk/-/issues/4373
plugins/dummy/gs-plugin-dummy.c | 2 +-
plugins/eos-updater/gs-plugin-eos-updater.c | 2 +-
.../fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c | 8 +++++---
3 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/plugins/dummy/gs-plugin-dummy.c b/plugins/dummy/gs-plugin-dummy.c
index 059f1c4ae..d6febfeff 100644
--- a/plugins/dummy/gs-plugin-dummy.c
+++ b/plugins/dummy/gs-plugin-dummy.c
@@ -819,7 +819,7 @@ gs_plugin_add_distro_upgrades (GsPlugin *plugin,
gs_app_set_license (app, GS_APP_QUALITY_LOWEST, "LicenseRef-free");
gs_app_set_management_plugin (app, gs_plugin_get_name (plugin));
gs_app_set_metadata (app, "GnomeSoftware::UpgradeBanner-css",
- "background: url('" DATADIR "/gnome-software/upgrade-bg.png');"
+ "background: url('file://" DATADIR "/gnome-software/upgrade-bg.png');"
"background-size: 100% 100%;"
"border-width: 0;");
gs_app_add_icon (app, ic);
diff --git a/plugins/eos-updater/gs-plugin-eos-updater.c b/plugins/eos-updater/gs-plugin-eos-updater.c
index 4679058c9..454898c5b 100644
--- a/plugins/eos-updater/gs-plugin-eos-updater.c
+++ b/plugins/eos-updater/gs-plugin-eos-updater.c
@@ -571,7 +571,7 @@ gs_plugin_setup (GsPlugin *plugin,
gs_app_add_quirk (app, GS_APP_QUIRK_NOT_REVIEWABLE);
gs_app_set_management_plugin (app, gs_plugin_get_name (plugin));
gs_app_set_metadata (app, "GnomeSoftware::UpgradeBanner-css",
- "background: url('" DATADIR "/gnome-software/upgrade-bg.png');"
+ "background: url('file://" DATADIR "/gnome-software/upgrade-bg.png');"
"background-size: 100% 100%;");
self->os_upgrade = g_steal_pointer (&app);
diff --git a/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
b/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
index 5865a1995..2da96f1db 100644
--- a/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
+++ b/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
@@ -262,19 +262,21 @@ _get_upgrade_css_background (guint version)
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
filename1 = g_strdup_printf (uri, version, version, version);
#pragma GCC diagnostic pop
+ if (*filename1 == '/')
+ return g_strdup_printf ("url('file://%s')", filename1);
return g_strdup_printf ("url('%s')", filename1);
}
}
filename1 = g_strdup_printf ("/usr/share/backgrounds/f%u/default/standard/f%u.png", version, version);
if (g_file_test (filename1, G_FILE_TEST_EXISTS))
- return g_strdup_printf ("url('%s')", filename1);
+ return g_strdup_printf ("url('file://%s')", filename1);
filename2 = g_strdup_printf ("/usr/share/gnome-software/backgrounds/f%u.png", version);
if (g_file_test (filename2, G_FILE_TEST_EXISTS))
- return g_strdup_printf ("url('%s')", filename2);
+ return g_strdup_printf ("url('file://%s')", filename2);
- return g_strdup ("url('" DATADIR "/gnome-software/upgrade-bg.png')");
+ return g_strdup ("url('file://" DATADIR "/gnome-software/upgrade-bg.png')");
}
static gint
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]