[gtk] window: Remove default icon list
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] window: Remove default icon list
- Date: Tue, 5 Feb 2019 13:12:50 +0000 (UTC)
commit e6c5b9348dc856a76edc92d1e0588bcd3767fca7
Author: Timm Bäder <mail baedert org>
Date: Sun Dec 30 06:53:35 2018 +0100
window: Remove default icon list
gtk/gtkaboutdialog.c | 20 +------------
gtk/gtkwindow.c | 83 ----------------------------------------------------
gtk/gtkwindow.h | 4 ---
3 files changed, 1 insertion(+), 106 deletions(-)
---
diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c
index 6fcfc1f764..3af89576ed 100644
--- a/gtk/gtkaboutdialog.c
+++ b/gtk/gtkaboutdialog.c
@@ -553,7 +553,7 @@ gtk_about_dialog_class_init (GtkAboutDialogClass *klass)
props[PROP_LOGO] =
g_param_spec_object ("logo",
P_("Logo"),
- P_("A logo for the about box. If this is not set, it defaults to
gtk_window_get_default_icon_list()"),
+ P_("A logo for the about box."),
GDK_TYPE_PAINTABLE,
GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
@@ -1745,18 +1745,6 @@ gtk_about_dialog_set_logo (GtkAboutDialog *about,
if (logo != NULL)
gtk_image_set_from_paintable (GTK_IMAGE (priv->logo_image), logo);
- else
- {
- GList *surfaces = gtk_window_get_default_icon_list ();
-
- if (surfaces != NULL)
- {
- gtk_image_set_from_paintable (GTK_IMAGE (priv->logo_image),
- GDK_PAINTABLE (surfaces->data));
-
- g_list_free (surfaces);
- }
- }
g_object_notify_by_pspec (G_OBJECT (about), props[PROP_LOGO]);
@@ -1800,7 +1788,6 @@ gtk_about_dialog_set_logo_icon_name (GtkAboutDialog *about,
const gchar *icon_name)
{
GtkAboutDialogPrivate *priv = gtk_about_dialog_get_instance_private (about);
- GList *icons;
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
@@ -1840,11 +1827,6 @@ gtk_about_dialog_set_logo_icon_name (GtkAboutDialog *about,
gtk_image_set_from_icon_name (GTK_IMAGE (priv->logo_image), icon_name);
gtk_image_set_pixel_size (GTK_IMAGE (priv->logo_image), best_size);
}
- else if ((icons = gtk_window_get_default_icon_list ()))
- {
- gtk_image_set_from_paintable (GTK_IMAGE (priv->logo_image), icons->data);
- g_list_free (icons);
- }
else
{
gtk_image_clear (GTK_IMAGE (priv->logo_image));
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index d98b85b356..bd217ab9c9 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -522,7 +522,6 @@ static void gtk_window_state_flags_changed (GtkWidget *widget,
static GListStore *toplevel_list = NULL;
static guint window_signals[LAST_SIGNAL] = { 0 };
-static GList *default_icon_list = NULL;
static gchar *default_icon_name = NULL;
static guint default_icon_serial = 0;
static gboolean disable_startup_notification = FALSE;
@@ -4557,14 +4556,6 @@ gtk_window_realize_icon (GtkWindow *window)
icon_list = ensure_icon_info (priv->transient_parent)->icon_list;
if (icon_list)
info->using_parent_icon = TRUE;
- }
-
- /* Inherit from default */
- if (icon_list == NULL)
- {
- icon_list = default_icon_list;
- if (icon_list)
- info->using_default_icon = TRUE;
}
/* Look up themed icon */
@@ -4675,9 +4666,6 @@ gtk_window_get_icon_for_size (GtkWindow *window,
return icon_from_list (info->icon_list, size);
}
- if (default_icon_list != NULL)
- return icon_from_list (default_icon_list, size);
-
if (default_icon_name != NULL)
return icon_from_name (default_icon_name, size);
@@ -4773,58 +4761,6 @@ gtk_window_get_icon_name (GtkWindow *window)
return info->icon_name;
}
-/**
- * gtk_window_set_default_icon_list:
- * @list: (element-type GdkTexture) (transfer container): a list of #GdkTextures
- *
- * Sets an icon list to be used as fallback for windows that haven't
- * had gtk_window_set_icon_list() called on them to set up a
- * window-specific icon list. This function allows you to set up the
- * icon for all windows in your app at once.
- *
- * See gtk_window_set_icon_list() for more details.
- *
- **/
-void
-gtk_window_set_default_icon_list (GList *list)
-{
- GList *toplevels;
- GList *tmp_list;
- if (list == default_icon_list)
- return;
-
- /* Update serial so we don't used cached pixmaps/masks
- */
- default_icon_serial++;
-
- g_list_foreach (list,
- (GFunc) g_object_ref, NULL);
-
- g_list_free_full (default_icon_list, g_object_unref);
-
- default_icon_list = g_list_copy (list);
-
- /* Update all toplevels */
- toplevels = gtk_window_list_toplevels ();
- tmp_list = toplevels;
- while (tmp_list != NULL)
- {
- GtkWindowIconInfo *info;
- GtkWindow *w = tmp_list->data;
-
- info = get_icon_info (w);
- if (info && info->using_default_icon)
- {
- gtk_window_unrealize_icon (w);
- if (_gtk_widget_get_realized (GTK_WIDGET (w)))
- gtk_window_realize_icon (w);
- }
-
- tmp_list = tmp_list->next;
- }
- g_list_free (toplevels);
-}
-
/**
* gtk_window_set_default_icon_name:
* @name: the name of the themed icon
@@ -4846,9 +4782,6 @@ gtk_window_set_default_icon_name (const gchar *name)
g_free (default_icon_name);
default_icon_name = g_strdup (name);
- g_list_free_full (default_icon_list, g_object_unref);
- default_icon_list = NULL;
-
/* Update all toplevels */
toplevels = gtk_window_list_toplevels ();
tmp_list = toplevels;
@@ -4887,22 +4820,6 @@ gtk_window_get_default_icon_name (void)
return default_icon_name;
}
-/**
- * gtk_window_get_default_icon_list:
- *
- * Gets the value set by gtk_window_set_default_icon_list().
- * The list is a copy and should be freed with g_list_free(),
- * but the surfaces in the list have not had their reference count
- * incremented.
- *
- * Returns: (element-type GdkTexture) (transfer container): copy of default icon list
- **/
-GList*
-gtk_window_get_default_icon_list (void)
-{
- return g_list_copy (default_icon_list);
-}
-
#define INCLUDE_CSD_SIZE 1
#define EXCLUDE_CSD_SIZE -1
diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h
index 8e5f1f25de..fb30ab99b8 100644
--- a/gtk/gtkwindow.h
+++ b/gtk/gtkwindow.h
@@ -278,10 +278,6 @@ void gtk_window_set_icon_name (GtkWindow *window,
GDK_AVAILABLE_IN_ALL
const gchar * gtk_window_get_icon_name (GtkWindow *window);
GDK_AVAILABLE_IN_ALL
-void gtk_window_set_default_icon_list (GList *list);
-GDK_AVAILABLE_IN_ALL
-GList* gtk_window_get_default_icon_list (void);
-GDK_AVAILABLE_IN_ALL
void gtk_window_set_default_icon_name (const gchar *name);
GDK_AVAILABLE_IN_ALL
const gchar * gtk_window_get_default_icon_name (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]