[goffice] Colour selector: work around gtk+ abi break.



commit 25ab07c14a2e16c835fc6497b140eed8901929ff
Author: Morten Welinder <terra gnome org>
Date:   Mon Jul 28 10:10:16 2014 -0400

    Colour selector: work around gtk+ abi break.

 ChangeLog                    |    8 ++++++++
 NEWS                         |    3 +++
 goffice/gtk/go-combo-color.c |    6 +++++-
 3 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7fd81cb..747bc37 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-07-28  Morten Welinder  <terra gnome org>
+
+       * goffice/gtk/go-combo-color.c
+       (go_combo_color_set_color_internal): Copy the pixbuf and set it
+       back onto the image.  An ABI change in gtk means that changes no
+       longer take effect right away if we just change the image's pixbuf
+       directly.  Fixes #733350.
+
 2014-07-25  Jean Brefort  <jean brefort normalesup org>
 
        * goffice/utils/go-style.c (cb_outline_size_changed),
diff --git a/NEWS b/NEWS
index f50cfd8..89f06fe 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,9 @@ Jean:
        * Fix grid line theme support. [#733403]
        * Fix default ticks position.
 
+Morten:
+       * Work around gtk+ ABI break for colour selector.  [#733350]
+
 --------------------------------------------------------------------------
 goffice 0.10.17:
 
diff --git a/goffice/gtk/go-combo-color.c b/goffice/gtk/go-combo-color.c
index 22a90a0..6bdc3c6 100644
--- a/goffice/gtk/go-combo-color.c
+++ b/goffice/gtk/go-combo-color.c
@@ -82,6 +82,8 @@ go_combo_color_set_color_internal (GOComboColor *cc, GOColor color, gboolean is_
        pixbuf = gtk_image_get_pixbuf (GTK_IMAGE (cc->preview_image));
        if (!pixbuf)
                return;
+       pixbuf = gdk_pixbuf_copy (pixbuf);
+
        width = gdk_pixbuf_get_width (pixbuf);
        height = gdk_pixbuf_get_height (pixbuf);
        if (cc->preview_is_icon) {
@@ -107,7 +109,9 @@ go_combo_color_set_color_internal (GOComboColor *cc, GOColor color, gboolean is_
        }
 
        g_object_unref (color_pixbuf);
-       gtk_widget_queue_draw (cc->preview_image);
+       gtk_image_set_from_pixbuf (GTK_IMAGE (cc->preview_image),
+                                  pixbuf);
+       g_object_unref (pixbuf);
 }
 
 static void


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