metacity r3668 - in trunk: . src/ui



Author: tthurman
Date: Sat Mar 29 21:29:57 2008
New Revision: 3668
URL: http://svn.gnome.org/viewvc/metacity?rev=3668&view=rev

Log:
2008-03-29  Thomas Thurman  <tthurman gnome org>

        * src/ui/preview-widget.c (meta_preview_get_clip_region):
        prevent null dereference if the theme was invalid, which
        caused crashes in gnome-appearance-properties.  No GNOME
        bug number, but I believe this is a fix for Launchpad bug
        #199402 and its many duplicates.



Modified:
   trunk/ChangeLog
   trunk/src/ui/preview-widget.c

Modified: trunk/src/ui/preview-widget.c
==============================================================================
--- trunk/src/ui/preview-widget.c	(original)
+++ trunk/src/ui/preview-widget.c	Sat Mar 29 21:29:57 2008
@@ -478,6 +478,19 @@
 
   flags = (META_PREVIEW (preview)->flags);
 
+  window_xregion = gdk_region_new ();
+
+  xrect.x = 0;
+  xrect.y = 0;
+  xrect.width = new_window_width;
+  xrect.height = new_window_height;
+
+  gdk_region_union_with_rect (window_xregion, &xrect);
+
+  if (preview->theme == NULL)
+    return window_xregion;
+
+  /* Otherwise, we do have a theme, so calculate the corners */
   frame_style = meta_theme_get_frame_style (preview->theme,
       META_FRAME_TYPE_NORMAL, flags);
 
@@ -558,14 +571,6 @@
         }
     }
 
-  window_xregion = gdk_region_new ();
-
-  xrect.x = 0;
-  xrect.y = 0;
-  xrect.width = new_window_width;
-  xrect.height = new_window_height;
-
-  gdk_region_union_with_rect (window_xregion, &xrect);
   gdk_region_subtract (window_xregion, corners_xregion);
   gdk_region_destroy (corners_xregion);
 



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