From 228e9a487c46b17a2d35cfcce9310baa0155238c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Thu, 30 May 2024 19:44:59 +0200 Subject: [PATCH 1/3] background-manager: Don't try to get background for zero size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we crash on gnome_bg_slide_show_get_slide on e.g. 0 width or height. Closes: https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1069 Signed-off-by: Guido Günther (cherry picked from commit 5df9eaca62d3586efe70d3007f69488679497805) Part-of: --- src/background-manager.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/background-manager.c b/src/background-manager.c index 47b99397c..7250d02ef 100644 --- a/src/background-manager.c +++ b/src/background-manager.c @@ -449,6 +449,11 @@ phosh_background_manager_get_data (PhoshBackgroundManager *self, PhoshBackground width = phosh_layer_surface_get_configured_width (PHOSH_LAYER_SURFACE (background)); height = phosh_layer_surface_get_configured_height (PHOSH_LAYER_SURFACE (background)); + if (width <= 0 || height <= 0) { + g_critical ("Layer surface not yet configured"); + return g_steal_pointer (&bg_data); + } + g_assert (GNOME_BG_IS_SLIDE_SHOW (self->slideshow)); /* TODO: handle actual slideshows (fixed == false) */ -- GitLab From 917df7360801183a8d1b8d57870ccd2ef1f7f453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Thu, 30 May 2024 20:03:37 +0200 Subject: [PATCH 2/3] background: Avoid update when the layer surface isn't configured yet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we might feed bogus values to GnomeBg. Closes: https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1069 Signed-off-by: Guido Günther Tested-by: Boud Roukema (cherry picked from commit 8c9a022a84cb83a8b8af88e01cbe9198d48707cf) Part-of: --- src/background.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/background.c b/src/background.c index 178ce225b..5333aa47a 100644 --- a/src/background.c +++ b/src/background.c @@ -455,5 +455,12 @@ phosh_background_needs_update (PhoshBackground *self) { g_return_if_fail (PHOSH_IS_BACKGROUND (self)); + /* Skip update if layer surface isn't yet configured, it will + * trigger on layer_surface.configured anyway */ + if (phosh_layer_surface_get_configured_width (PHOSH_LAYER_SURFACE (self)) <= 0 || + phosh_layer_surface_get_configured_height (PHOSH_LAYER_SURFACE (self)) <= 0) { + return; + } + trigger_update (self); } -- GitLab From ad108952d2d97b1b73c1f5372cb369a3121f11fe Mon Sep 17 00:00:00 2001 From: Arun Mani J Date: Sat, 8 Jun 2024 20:59:00 +0530 Subject: [PATCH 3/3] app-grid-folder-button: Force 16px as icon size Closes: https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1072 (cherry picked from commit 5796afc5d82d3c10dc8822245a1dcc5a0e495018) Part-of: --- src/app-grid-folder-button.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app-grid-folder-button.c b/src/app-grid-folder-button.c index 05e4b2879..bed953a4b 100644 --- a/src/app-grid-folder-button.c +++ b/src/app-grid-folder-button.c @@ -116,6 +116,7 @@ build_2x2_grid_icon (PhoshAppGridFolderButton *self) image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_BUTTON); } + gtk_image_set_pixel_size (GTK_IMAGE (image), 16); gtk_widget_set_visible (image, TRUE); gtk_grid_attach (self->grid, image, i % 2, i >= 2, 1, 1); } -- GitLab