[libwnck/wip/muktupavels/gnome-3-20] tasklist: ignore size_allocate with invalid size



commit 9f6ccf0bc63bdd9ef30d50167979330dff8f3683
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 8144712..c464a0d 100644
--- a/libwnck/tasklist.c
+++ b/libwnck/tasklist.c
@@ -1495,6 +1495,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]