[gtk+] GtkWindow: Tidy up after icon became a cairo surface
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkWindow: Tidy up after icon became a cairo surface
- Date: Fri, 3 Nov 2017 19:06:49 +0000 (UTC)
commit 23014438d617a89e12b26a4fad4f0cff296175eb
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Fri Nov 3 20:05:28 2017 +0100
GtkWindow: Tidy up after icon became a cairo surface
Use g_value_set/get_boxed() in gtk_window_get/set_property(), case PROP_ICON.
icon_from_list() shall always add a reference to the returned icon.
gtk_window_set_icon() must accept icon != NULL.
https://bugzilla.gnome.org/show_bug.cgi?id=789870
gtk/gtkwindow.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index e790399..574ac9f 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -2008,7 +2008,7 @@ gtk_window_set_property (GObject *object,
break;
case PROP_ICON:
gtk_window_set_icon (window,
- g_value_get_object (value));
+ g_value_get_boxed (value));
break;
case PROP_ICON_NAME:
gtk_window_set_icon_name (window, g_value_get_string (value));
@@ -2118,7 +2118,7 @@ gtk_window_get_property (GObject *object,
g_value_set_boolean (value, priv->destroy_with_parent);
break;
case PROP_ICON:
- g_value_set_object (value, gtk_window_get_icon (window));
+ g_value_set_boxed (value, gtk_window_get_icon (window));
break;
case PROP_ICON_NAME:
g_value_set_string (value, gtk_window_get_icon_name (window));
@@ -4574,7 +4574,7 @@ icon_from_list (GtkWindow *window,
}
if (best == NULL && list != NULL)
- best = (cairo_surface_t *)list->data;
+ best = cairo_surface_reference ((cairo_surface_t *)list->data);
if (best)
@@ -4781,7 +4781,7 @@ gtk_window_set_icon (GtkWindow *window,
GList *list;
g_return_if_fail (GTK_IS_WINDOW (window));
- g_return_if_fail (icon == NULL);
+ g_return_if_fail (icon == NULL || cairo_surface_get_type (icon) == CAIRO_SURFACE_TYPE_IMAGE);
list = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]