diff --git a/src/Makefile.am b/src/Makefile.am index 8df85fbd7..45c9cdede 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -128,8 +128,8 @@ libmutter_wayland_la_SOURCES = \ core/group-props.h \ core/group.c \ meta/group.h \ - core/iconcache.c \ - core/iconcache.h \ + core/icons.c \ + core/icons.h \ core/keybindings.c \ core/keybindings-private.h \ core/main.c \ diff --git a/src/core/core.c b/src/core/core.c index cb2a747e5..05029d5dc 100644 --- a/src/core/core.c +++ b/src/core/core.c @@ -736,31 +736,6 @@ meta_core_increment_event_serial (Display *xdisplay) meta_display_increment_event_serial (display); } -void -meta_invalidate_default_icons (void) -{ - MetaDisplay *display = meta_get_display (); - GSList *windows; - GSList *l; - - if (display == NULL) - return; /* We can validly be called before the display is opened. */ - - windows = meta_display_list_windows (display, META_LIST_DEFAULT); - for (l = windows; l != NULL; l = l->next) - { - MetaWindow *window = (MetaWindow*)l->data; - - if (window->icon_cache.origin == USING_FALLBACK_ICON) - { - meta_icon_cache_free (&(window->icon_cache)); - meta_window_update_icon_now (window); - } - } - - g_slist_free (windows); -} - void meta_core_add_old_event_mask (Display *xdisplay, Window xwindow, diff --git a/src/core/core.h b/src/core/core.h index a3321531b..f7c6202ef 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -199,8 +199,6 @@ void meta_core_set_screen_cursor (Display *xdisplay, */ void meta_core_increment_event_serial (Display *display); -void meta_invalidate_default_icons (void); - void meta_core_add_old_event_mask (Display *xdisplay, Window xwindow, XIEventMask *mask); diff --git a/src/core/iconcache.c b/src/core/icons.c similarity index 100% rename from src/core/iconcache.c rename to src/core/icons.c diff --git a/src/core/iconcache.h b/src/core/icons.h similarity index 100% rename from src/core/iconcache.h rename to src/core/icons.h diff --git a/src/core/window-private.h b/src/core/window-private.h index aa5525ee2..8a334e359 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -92,7 +92,6 @@ struct _MetaWindow char *icon_name; GdkPixbuf *icon; GdkPixbuf *mini_icon; - MetaIconCache icon_cache; Pixmap wm_hints_pixmap; Pixmap wm_hints_mask; diff --git a/src/core/window-props.c b/src/core/window-props.c index dc6f9ba70..c34d8b4df 100644 --- a/src/core/window-props.c +++ b/src/core/window-props.c @@ -237,9 +237,6 @@ static void reload_icon (MetaWindow *window, Atom atom) { - meta_icon_cache_property_changed (&window->icon_cache, - window->display, - atom); meta_window_queue(window, META_QUEUE_UPDATE_ICON); } @@ -1503,10 +1500,6 @@ reload_wm_hints (MetaWindow *window, if (!initial && window->wm_hints_urgent && !old_urgent) g_signal_emit_by_name (window->display, "window-marked-urgent", window); - meta_icon_cache_property_changed (&window->icon_cache, - window->display, - XA_WM_HINTS); - meta_window_queue (window, META_QUEUE_UPDATE_ICON | META_QUEUE_MOVE_RESIZE); } diff --git a/src/core/window.c b/src/core/window.c index a0335aa46..10a005e56 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -233,8 +233,6 @@ meta_window_finalize (GObject *object) if (window->transient_for) g_object_unref (window->transient_for); - meta_icon_cache_free (&window->icon_cache); - g_free (window->sm_client_id); g_free (window->wm_client_machine); g_free (window->startup_id); @@ -818,7 +816,6 @@ _meta_window_shared_new (MetaDisplay *display, window->icon_name = NULL; window->icon = NULL; window->mini_icon = NULL; - meta_icon_cache_init (&window->icon_cache); window->wm_hints_pixmap = None; window->wm_hints_mask = None; window->wm_hints_urgent = FALSE; @@ -6793,25 +6790,13 @@ meta_window_update_icon_now (MetaWindow *window) icon = NULL; mini_icon = NULL; - if (meta_read_icons (window->screen, - window->xwindow, - &window->icon_cache, - window->wm_hints_pixmap, - window->wm_hints_mask, - &icon, - META_ICON_WIDTH, META_ICON_HEIGHT, - &mini_icon, - META_MINI_ICON_WIDTH, - META_MINI_ICON_HEIGHT)) + if (read_icons (window->screen, + window->xwindow, + window->wm_hints_pixmap, + window->wm_hints_mask, + &window->icon)) { - if (window->icon) - g_object_unref (G_OBJECT (window->icon)); - - if (window->mini_icon) - g_object_unref (G_OBJECT (window->mini_icon)); - window->icon = icon; - window->mini_icon = mini_icon; g_object_freeze_notify (G_OBJECT (window)); g_object_notify (G_OBJECT (window), "icon"); diff --git a/src/meta/common.h b/src/meta/common.h index f81d763d7..d462561bb 100644 --- a/src/meta/common.h +++ b/src/meta/common.h @@ -492,12 +492,6 @@ struct _MetaFrameBorders /* sets all dimensions to zero */ void meta_frame_borders_clear (MetaFrameBorders *self); -/* should investigate changing these to whatever most apps use */ -#define META_ICON_WIDTH 96 -#define META_ICON_HEIGHT 96 -#define META_MINI_ICON_WIDTH 16 -#define META_MINI_ICON_HEIGHT 16 - #define META_DEFAULT_ICON_NAME "window" /* Main loop priorities determine when activity in the GLib diff --git a/src/ui/ui.c b/src/ui/ui.c index 1a19838f4..6a7c9ed73 100644 --- a/src/ui/ui.c +++ b/src/ui/ui.c @@ -598,76 +598,6 @@ meta_gdk_pixbuf_get_from_pixmap (Pixmap xpixmap, return retval; } -GdkPixbuf* -meta_ui_get_default_window_icon (MetaUI *ui) -{ - static GdkPixbuf *default_icon = NULL; - - if (default_icon == NULL) - { - GtkIconTheme *theme; - gboolean icon_exists; - - theme = gtk_icon_theme_get_default (); - - icon_exists = gtk_icon_theme_has_icon (theme, META_DEFAULT_ICON_NAME); - - if (icon_exists) - default_icon = gtk_icon_theme_load_icon (theme, - META_DEFAULT_ICON_NAME, - META_ICON_WIDTH, - 0, - NULL); - else - default_icon = gtk_icon_theme_load_icon (theme, - "image-missing", - META_ICON_WIDTH, - 0, - NULL); - - g_assert (default_icon); - } - - g_object_ref (G_OBJECT (default_icon)); - - return default_icon; -} - -GdkPixbuf* -meta_ui_get_default_mini_icon (MetaUI *ui) -{ - static GdkPixbuf *default_icon = NULL; - - if (default_icon == NULL) - { - GtkIconTheme *theme; - gboolean icon_exists; - - theme = gtk_icon_theme_get_default (); - - icon_exists = gtk_icon_theme_has_icon (theme, META_DEFAULT_ICON_NAME); - - if (icon_exists) - default_icon = gtk_icon_theme_load_icon (theme, - META_DEFAULT_ICON_NAME, - META_MINI_ICON_WIDTH, - 0, - NULL); - else - default_icon = gtk_icon_theme_load_icon (theme, - "image-missing", - META_MINI_ICON_WIDTH, - 0, - NULL); - - g_assert (default_icon); - } - - g_object_ref (G_OBJECT (default_icon)); - - return default_icon; -} - gboolean meta_ui_window_should_not_cause_focus (Display *xdisplay, Window xwindow) @@ -775,7 +705,6 @@ void meta_ui_set_current_theme (const char *name) { meta_theme_set_current (name); - meta_invalidate_default_icons (); } gboolean diff --git a/src/ui/ui.h b/src/ui/ui.h index ca52f4c45..d82dc7d8d 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -143,9 +143,6 @@ GdkPixbuf* meta_gdk_pixbuf_get_from_pixmap (Pixmap xpixmap, int width, int height); -GdkPixbuf* meta_ui_get_default_window_icon (MetaUI *ui); -GdkPixbuf* meta_ui_get_default_mini_icon (MetaUI *ui); - gboolean meta_ui_window_should_not_cause_focus (Display *xdisplay, Window xwindow);