1 Star 0 Fork 10

huyab/gnome-software

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-crash-with-broken-theme.patch 1.51 KB
一键复制 编辑 原始数据 按行查看 历史
deng weijin 提交于 2022-07-01 11:44 +08:00 . Update to 42.2
Subject: [PATCH] gs-feature-tile: Do not abort when the theme is broken
Just print a warning when the theme doesn't provide 'theme_fg_color' and
fallback to black color.
Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1228
diff -up gnome-software-42.rc/src/gs-feature-tile.c.1 gnome-software-42.rc/src/gs-feature-tile.c
--- gnome-software-42.rc/src/gs-feature-tile.c.1 2022-03-04 16:23:58.566735700 +0100
+++ gnome-software-42.rc/src/gs-feature-tile.c 2022-03-07 08:06:29.046595524 +0100
@@ -411,7 +411,6 @@ gs_feature_tile_refresh (GsAppTile *self
if (key_colors != tile->key_colors_cache) {
g_autoptr(GArray) colors = NULL;
GdkRGBA fg_rgba;
- gboolean fg_rgba_valid;
GsHSBC fg_hsbc;
const GsHSBC *chosen_hsbc;
GsHSBC chosen_hsbc_modified;
@@ -429,8 +428,17 @@ gs_feature_tile_refresh (GsAppTile *self
* @min_abs_contrast contrast with the foreground, so
* that the text is legible.
*/
- 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;
+ }
gtk_rgb_to_hsv (fg_rgba.red, fg_rgba.green, fg_rgba.blue,
&fg_hsbc.hue, &fg_hsbc.saturation, &fg_hsbc.brightness);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/huyab/gnome-software.git
git@gitee.com:huyab/gnome-software.git
huyab
gnome-software
gnome-software
master

搜索帮助