summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2012-05-22 15:16:29 -0400
committerWilliam Jon McCann <jmccann@redhat.com>2012-05-22 15:16:29 -0400
commit784c1bb1f2cbdc06a9e1a5539f6dab163ceb9751 (patch)
tree692950c1a2bc53a8ba4d699dd5b26b6be873001d
parent5c8ddbc044ae32115c636be02b5f57a03c2d35d2 (diff)
downloadgnome-control-center-wip/background-content.tar.gz
Couple of fixeswip/background-content
-rw-r--r--panels/background/cc-background-panel.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c
index bc3285703..5fa5daf6d 100644
--- a/panels/background/cc-background-panel.c
+++ b/panels/background/cc-background-panel.c
@@ -139,6 +139,8 @@ cc_background_panel_dispose (GObject *object)
}
g_free (priv->screenshot_path);
+ priv->screenshot_path = NULL;
+
g_clear_object (&priv->connection);
G_OBJECT_CLASS (cc_background_panel_parent_class)->dispose (object);
@@ -309,9 +311,6 @@ on_screenshot_finished (GObject *source,
goto out;
}
- /* remove the temporary file created by the shell */
- g_unlink (panel->priv->screenshot_path);
-
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
@@ -336,6 +335,11 @@ on_screenshot_finished (GObject *source,
0, 0,
width,
height);
+ /* remove the temporary file created by the shell */
+ g_unlink (panel->priv->screenshot_path);
+ g_free (priv->screenshot_path);
+ priv->screenshot_path = NULL;
+
cairo_destroy (cr);
cairo_surface_destroy (surface);
@@ -386,7 +390,9 @@ on_preview_draw (GtkWidget *widget,
cairo_t *cr,
CcBackgroundPanel *panel)
{
- if (!panel->priv->display_screenshot)
+ /* we have another shot in flight or an existing cache */
+ if (panel->priv->display_screenshot == NULL
+ && panel->priv->screenshot_path == NULL)
{
GdkRectangle rect;