[libwnck] pager: don't return invalid workspace rect



commit 2fc0f058f00daf76c06e485c9d39491513f48345
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Wed Oct 15 07:34:24 2014 +0300

    pager: don't return invalid workspace rect
    
    Make sure that get_workspace_rect does not return invalid workspace
    rectangle. Looks like this functions gets called before allocation
    is set on pager widget. In this case set rect->{x,y,widht,height}
    to 0.
    
    This fixes following bug in gnome-pane:
    *** BUG ***
    In pixman_region32_init_rect: Invalid rectangle passed
    Set a breakpoint on '_pixman_log_error' to debug

 libwnck/pager.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/libwnck/pager.c b/libwnck/pager.c
index 690ed33..eef90c7 100644
--- a/libwnck/pager.c
+++ b/libwnck/pager.c
@@ -788,6 +788,17 @@ get_workspace_rect (WnckPager    *pager,
 
   gtk_widget_get_allocation (widget, &allocation);
 
+  if (allocation.x == -1 || allocation.y == -1 ||
+      allocation.width == -1 || allocation.height == -1)
+    {
+      rect->x = 0;
+      rect->y = 0;
+      rect->width = 0;
+      rect->height = 0;
+
+      return;
+    }
+
   _wnck_pager_get_padding (pager, &padding);
   gtk_widget_style_get (widget,
                        "focus-line-width", &focus_width,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]