[gnome-control-center/wip/jsparber/background: 3/28] background: clear settings object in dispose
- From: Julian Sparber <jsparber src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/jsparber/background: 3/28] background: clear settings object in dispose
- Date: Sat, 17 Feb 2018 19:41:46 +0000 (UTC)
commit 44e6f80fe23067b85ebb4ab209be2befd2d97b9b
Author: Julian Sparber <julian sparber net>
Date: Tue Nov 7 04:16:22 2017 +0100
background: clear settings object in dispose
https://bugzilla.gnome.org/show_bug.cgi?id=788515
panels/background/cc-background-panel.c | 32 +++++++++++++++++++++++++++-----
1 file changed, 27 insertions(+), 5 deletions(-)
---
diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c
index 5f74e5a39..cc88edd1f 100644
--- a/panels/background/cc-background-panel.c
+++ b/panels/background/cc-background-panel.c
@@ -83,6 +83,8 @@ cc_background_panel_dispose (GObject *object)
/* destroying the builder object will also destroy the spinner */
panel->spinner = NULL;
+ g_clear_object (&panel->settings);
+
if (panel->copy_cancellable)
{
/* cancel any copy operation */
@@ -103,7 +105,6 @@ cc_background_panel_finalize (GObject *object)
g_clear_object (&panel->current_background);
g_clear_object (&panel->store);
- g_clear_object (&panel->settings);
G_OBJECT_CLASS (cc_background_panel_parent_class)->finalize (object);
}
@@ -167,11 +168,13 @@ get_or_create_cached_pixbuf (CcBackgroundPanel *panel,
CcBackgroundItem *background)
{
GtkAllocation allocation;
- const gint preview_width = 309;
- const gint preview_height = 168;
+
+ //const gint preview_width;// = 310; //309
+ //const gint preview_height;// = 174; //168
gint scale_factor;
GdkPixbuf *pixbuf;
- GdkPixbuf *pixbuf_tmp;
+ const gint preview_width = gtk_widget_get_allocated_width (widget);
+ const gint preview_height = gtk_widget_get_allocated_height (widget);
pixbuf = g_object_get_data (G_OBJECT (background), "pixbuf");
if (pixbuf == NULL)
@@ -196,6 +199,7 @@ on_preview_draw (GtkWidget *widget,
CcBackgroundPanel *panel)
{
GdkPixbuf *pixbuf;
+
pixbuf = get_or_create_cached_pixbuf (panel,
widget,
panel->current_background);
@@ -207,6 +211,15 @@ on_preview_draw (GtkWidget *widget,
return TRUE;
}
+static gboolean
+resize_preview (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data)
+{
+ g_print ("run me");
+ return TRUE;
+}
+
static void
reload_current_bg (CcBackgroundPanel *panel,
GSettings *settings)
@@ -572,9 +585,17 @@ is_gnome_photos_installed ()
return TRUE;
}
+static void
+on_window_resize (GtkWidget *widget,
+ GdkRectangle *allocation,
+ gpointer user_data)
+{
+ g_print ("New size\n");
+}
+
static GtkWidget *
create_gallery_item (gpointer item,
- gpointer user_data)
+ gpointer user_data)
{
CcBackgroundPanel *panel = user_data;
GtkWidget *flow;
@@ -689,4 +710,5 @@ cc_background_panel_init (CcBackgroundPanel *panel)
/* Background settings */
g_signal_connect (panel->settings, "changed", G_CALLBACK (on_settings_changed), panel);
+ g_signal_connect (panel, "configure-event", G_CALLBACK (resize_preview), panel);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]