summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--src/ui/preview-widget.c21
2 files changed, 21 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 40bc012..c86d749 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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.
+
2008-03-28 Owen Taylor <otaylor@redhat.com>
* src/core/window.c (meta_window_new_with_attrs): Don't
diff --git a/src/ui/preview-widget.c b/src/ui/preview-widget.c
index c0ac6d7..4d2f9a2 100644
--- a/src/ui/preview-widget.c
+++ b/src/ui/preview-widget.c
@@ -478,6 +478,19 @@ meta_preview_get_clip_region (MetaPreview *preview, gint new_window_width, gint
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 @@ meta_preview_get_clip_region (MetaPreview *preview, gint new_window_width, gint
}
}
- 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);