[notification-daemon] Guard against height being zero



commit 2092c140246feb488b24fe01eecd246e121afed4
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jan 16 12:52:12 2010 -0500

    Guard against height being zero
    
    Fix for https://bugzilla.redhat.com/show_bug.cgi?id=548504

 src/themes/slider/theme.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/themes/slider/theme.c b/src/themes/slider/theme.c
index 88b4e07..d1f1963 100644
--- a/src/themes/slider/theme.c
+++ b/src/themes/slider/theme.c
@@ -181,6 +181,11 @@ update_shape (WindowData *windata)
         GdkBitmap *mask;
         cairo_t   *cr;
 
+        if (windata->width == 0 || windata->height == 0) {
+                windata->width = MAX (windata->win->allocation.width, 1);
+                windata->height = MAX (windata->win->allocation.height, 1);
+        }
+
         if (windata->composited) {
                 gtk_widget_shape_combine_mask (windata->win, NULL, 0, 0);
                 return;
@@ -223,9 +228,9 @@ paint_window (GtkWidget     *widget,
         cairo_surface_t *surface;
         cairo_t         *cr;
 
-        if (windata->width == 0) {
-                windata->width = windata->win->allocation.width;
-                windata->height = windata->win->allocation.height;
+        if (windata->width == 0 || windata->height == 0) {
+                windata->width = MAX (windata->win->allocation.width, 1);
+                windata->height = MAX (windata->win->allocation.height, 1);
         }
 
         context = gdk_cairo_create (widget->window);



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