[gtk/wip/baedert/window-icons2: 7/10] window: Remove default icon list
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/window-icons2: 7/10] window: Remove default icon list
- Date: Sun, 30 Dec 2018 06:24:53 +0000 (UTC)
commit a40dc944d659eae386efdcb1f85968fdf350b46c
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 6503f4ddaf..cd0cf62c2e 100644
--- a/gtk/gtkaboutdialog.c
+++ b/gtk/gtkaboutdialog.c
@@ -554,7 +554,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);
@@ -1756,18 +1756,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]);
@@ -1811,7 +1799,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));
@@ -1851,11 +1838,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 203da423bc..bfe05a9290 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -522,7 +522,6 @@ static void gtk_surface_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;
@@ -4561,14 +4560,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 */
@@ -4679,9 +4670,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);
@@ -4777,58 +4765,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
@@ -4850,9 +4786,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;
@@ -4891,22 +4824,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]