[libwnck/wip/muktupavels/gnome-3-18: 8/8] tasklist: ignore size_allocate with invalid size
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libwnck/wip/muktupavels/gnome-3-18: 8/8] tasklist: ignore size_allocate with invalid size
- Date: Tue, 28 Jun 2016 09:03:48 +0000 (UTC)
commit a77f3cfd27a828cd11c92f06b95ea3fbbe73b63f
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sat Apr 16 21:07:34 2016 +0300
tasklist: ignore size_allocate with invalid size
Ignore wnck_tasklist_size_allocate if it is called with invalid
size. It makes no sense to try calculate button allocations if
width or height of tasklist is <=1.
This fixes this warning:
Negative content width -7 (allocation 1, extents 4x4) while
allocating gadget (node button, owner GtkToggleButton)
libwnck/tasklist.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/libwnck/tasklist.c b/libwnck/tasklist.c
index bd99489..a106af2 100644
--- a/libwnck/tasklist.c
+++ b/libwnck/tasklist.c
@@ -1497,6 +1497,12 @@ wnck_tasklist_size_allocate (GtkWidget *widget,
GList *windows_sorted = NULL;
int grouping_limit;
+ if (allocation->width <= 1 || allocation->height <= 1)
+ {
+ GTK_WIDGET_CLASS (wnck_tasklist_parent_class)->size_allocate (widget, allocation);
+ return;
+ }
+
tasklist = WNCK_TASKLIST (widget);
n_windows = g_list_length (tasklist->priv->windows);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]