diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2021-04-28 01:28:48 +0300 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2021-04-28 01:28:48 +0300 |
commit | b1596999e7f5dbd8eb8d052e1a828506e491985b (patch) | |
tree | 4402cb8b8e2202e2743b59a23da88685836252af | |
parent | 6fdf7eac035cd66bff77d56c4b2710f46bc286bf (diff) | |
download | libwnck-b1596999e7f5dbd8eb8d052e1a828506e491985b.tar.gz |
pager: don't return negative size
wnck_screen_get_workspace_count can return 0 if WnckScreen has
not been updated yet.
-rw-r--r-- | libwnck/pager.c | 4 |
1 files 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 |