This commit is contained in:
Jasper St. Pierre 2012-12-03 14:52:36 -05:00
parent 1502d2a79f
commit 2a0dee9883
11 changed files with 7 additions and 137 deletions

View File

@ -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 \

View File

@ -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,

View File

@ -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);

View File

@ -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;

View File

@ -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);
}

View File

@ -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");

View File

@ -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

View File

@ -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

View File

@ -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);