gnome-software/0001-crash-with-broken-theme.patch

34 lines
1.3 KiB
Diff
Raw Normal View History

2023-01-09 08:52:04 +00:00
diff -up gnome-software-devel/src/gs-feature-tile.c.1 gnome-software-devel/src/gs-feature-tile.c
--- gnome-software-devel/src/gs-feature-tile.c.1 2023-01-02 17:08:54.157641969 +0100
+++ gnome-software-devel/src/gs-feature-tile.c 2023-01-02 17:09:36.881632780 +0100
@@ -397,9 +397,6 @@ gs_feature_tile_refresh (GsAppTile *self
2021-06-04 08:32:18 +00:00
if (key_colors != tile->key_colors_cache) {
g_autoptr(GArray) colors = NULL;
GdkRGBA fg_rgba;
2023-01-09 08:52:04 +00:00
-#if !GTK_CHECK_VERSION(4, 9, 2)
2021-06-04 08:32:18 +00:00
- gboolean fg_rgba_valid;
2023-01-09 08:52:04 +00:00
-#endif
2021-06-04 08:32:18 +00:00
GsHSBC fg_hsbc;
2022-03-07 07:15:08 +00:00
const GsHSBC *chosen_hsbc;
GsHSBC chosen_hsbc_modified;
2023-01-09 08:52:04 +00:00
@@ -424,8 +421,17 @@ gs_feature_tile_refresh (GsAppTile *self
gtk_widget_get_color (GTK_WIDGET (self), &fg_rgba);
#else
context = gtk_widget_get_style_context (GTK_WIDGET (self));
2021-06-04 08:32:18 +00:00
- fg_rgba_valid = gtk_style_context_lookup_color (context, "theme_fg_color", &fg_rgba);
- g_assert (fg_rgba_valid);
+ if (!gtk_style_context_lookup_color (context, "theme_fg_color", &fg_rgba)) {
+ static gboolean i_know = FALSE;
+ if (!i_know) {
+ i_know = TRUE;
+ g_warning ("The theme doesn't provide 'theme_fg_color', fallbacking to black");
+ }
+ fg_rgba.red = 0.0;
+ fg_rgba.green = 0.0;
+ fg_rgba.blue = 0.0;
+ fg_rgba.alpha = 1.0;
+ }
2023-01-09 08:52:04 +00:00
#endif
2021-06-04 08:32:18 +00:00
gtk_rgb_to_hsv (fg_rgba.red, fg_rgba.green, fg_rgba.blue,