From b1596999e7f5dbd8eb8d052e1a828506e491985b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= Date: Wed, 28 Apr 2021 01:28:48 +0300 Subject: pager: don't return negative size wnck_screen_get_workspace_count can return 0 if WnckScreen has not been updated yet. --- libwnck/pager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libwnck/pager.c b/libwnck/pager.c index 32d146b..c1d4f43 100644 --- a/libwnck/pager.c +++ b/libwnck/pager.c @@ -622,7 +622,7 @@ wnck_pager_get_preferred_width_for_height (GtkWidget *widget, workspace_height); width += workspace_width * spaces_per_row + (spaces_per_row - 1); - *natural_width = *minimum_width = width; + *natural_width = *minimum_width = MAX (width, 0); } static void @@ -684,7 +684,7 @@ wnck_pager_get_preferred_height_for_width (GtkWidget *widget, workspace_width); height += workspace_height * spaces_per_row + (spaces_per_row - 1); - *natural_height = *minimum_height = height; + *natural_height = *minimum_height = MAX (height, 0); } static gboolean -- cgit v1.2.1