mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 17:10:40 -05:00
icons
This commit is contained in:
parent
1502d2a79f
commit
2a0dee9883
@ -128,8 +128,8 @@ libmutter_wayland_la_SOURCES = \
|
|||||||
core/group-props.h \
|
core/group-props.h \
|
||||||
core/group.c \
|
core/group.c \
|
||||||
meta/group.h \
|
meta/group.h \
|
||||||
core/iconcache.c \
|
core/icons.c \
|
||||||
core/iconcache.h \
|
core/icons.h \
|
||||||
core/keybindings.c \
|
core/keybindings.c \
|
||||||
core/keybindings-private.h \
|
core/keybindings-private.h \
|
||||||
core/main.c \
|
core/main.c \
|
||||||
|
@ -736,31 +736,6 @@ meta_core_increment_event_serial (Display *xdisplay)
|
|||||||
meta_display_increment_event_serial (display);
|
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
|
void
|
||||||
meta_core_add_old_event_mask (Display *xdisplay,
|
meta_core_add_old_event_mask (Display *xdisplay,
|
||||||
Window xwindow,
|
Window xwindow,
|
||||||
|
@ -199,8 +199,6 @@ void meta_core_set_screen_cursor (Display *xdisplay,
|
|||||||
*/
|
*/
|
||||||
void meta_core_increment_event_serial (Display *display);
|
void meta_core_increment_event_serial (Display *display);
|
||||||
|
|
||||||
void meta_invalidate_default_icons (void);
|
|
||||||
|
|
||||||
void meta_core_add_old_event_mask (Display *xdisplay,
|
void meta_core_add_old_event_mask (Display *xdisplay,
|
||||||
Window xwindow,
|
Window xwindow,
|
||||||
XIEventMask *mask);
|
XIEventMask *mask);
|
||||||
|
@ -92,7 +92,6 @@ struct _MetaWindow
|
|||||||
char *icon_name;
|
char *icon_name;
|
||||||
GdkPixbuf *icon;
|
GdkPixbuf *icon;
|
||||||
GdkPixbuf *mini_icon;
|
GdkPixbuf *mini_icon;
|
||||||
MetaIconCache icon_cache;
|
|
||||||
Pixmap wm_hints_pixmap;
|
Pixmap wm_hints_pixmap;
|
||||||
Pixmap wm_hints_mask;
|
Pixmap wm_hints_mask;
|
||||||
|
|
||||||
|
@ -237,9 +237,6 @@ static void
|
|||||||
reload_icon (MetaWindow *window,
|
reload_icon (MetaWindow *window,
|
||||||
Atom atom)
|
Atom atom)
|
||||||
{
|
{
|
||||||
meta_icon_cache_property_changed (&window->icon_cache,
|
|
||||||
window->display,
|
|
||||||
atom);
|
|
||||||
meta_window_queue(window, META_QUEUE_UPDATE_ICON);
|
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)
|
if (!initial && window->wm_hints_urgent && !old_urgent)
|
||||||
g_signal_emit_by_name (window->display, "window-marked-urgent", window);
|
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);
|
meta_window_queue (window, META_QUEUE_UPDATE_ICON | META_QUEUE_MOVE_RESIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,8 +233,6 @@ meta_window_finalize (GObject *object)
|
|||||||
if (window->transient_for)
|
if (window->transient_for)
|
||||||
g_object_unref (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->sm_client_id);
|
||||||
g_free (window->wm_client_machine);
|
g_free (window->wm_client_machine);
|
||||||
g_free (window->startup_id);
|
g_free (window->startup_id);
|
||||||
@ -818,7 +816,6 @@ _meta_window_shared_new (MetaDisplay *display,
|
|||||||
window->icon_name = NULL;
|
window->icon_name = NULL;
|
||||||
window->icon = NULL;
|
window->icon = NULL;
|
||||||
window->mini_icon = NULL;
|
window->mini_icon = NULL;
|
||||||
meta_icon_cache_init (&window->icon_cache);
|
|
||||||
window->wm_hints_pixmap = None;
|
window->wm_hints_pixmap = None;
|
||||||
window->wm_hints_mask = None;
|
window->wm_hints_mask = None;
|
||||||
window->wm_hints_urgent = FALSE;
|
window->wm_hints_urgent = FALSE;
|
||||||
@ -6793,25 +6790,13 @@ meta_window_update_icon_now (MetaWindow *window)
|
|||||||
icon = NULL;
|
icon = NULL;
|
||||||
mini_icon = NULL;
|
mini_icon = NULL;
|
||||||
|
|
||||||
if (meta_read_icons (window->screen,
|
if (read_icons (window->screen,
|
||||||
window->xwindow,
|
window->xwindow,
|
||||||
&window->icon_cache,
|
window->wm_hints_pixmap,
|
||||||
window->wm_hints_pixmap,
|
window->wm_hints_mask,
|
||||||
window->wm_hints_mask,
|
&window->icon))
|
||||||
&icon,
|
|
||||||
META_ICON_WIDTH, META_ICON_HEIGHT,
|
|
||||||
&mini_icon,
|
|
||||||
META_MINI_ICON_WIDTH,
|
|
||||||
META_MINI_ICON_HEIGHT))
|
|
||||||
{
|
{
|
||||||
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->icon = icon;
|
||||||
window->mini_icon = mini_icon;
|
|
||||||
|
|
||||||
g_object_freeze_notify (G_OBJECT (window));
|
g_object_freeze_notify (G_OBJECT (window));
|
||||||
g_object_notify (G_OBJECT (window), "icon");
|
g_object_notify (G_OBJECT (window), "icon");
|
||||||
|
@ -492,12 +492,6 @@ struct _MetaFrameBorders
|
|||||||
/* sets all dimensions to zero */
|
/* sets all dimensions to zero */
|
||||||
void meta_frame_borders_clear (MetaFrameBorders *self);
|
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"
|
#define META_DEFAULT_ICON_NAME "window"
|
||||||
|
|
||||||
/* Main loop priorities determine when activity in the GLib
|
/* Main loop priorities determine when activity in the GLib
|
||||||
|
71
src/ui/ui.c
71
src/ui/ui.c
@ -598,76 +598,6 @@ meta_gdk_pixbuf_get_from_pixmap (Pixmap xpixmap,
|
|||||||
return retval;
|
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
|
gboolean
|
||||||
meta_ui_window_should_not_cause_focus (Display *xdisplay,
|
meta_ui_window_should_not_cause_focus (Display *xdisplay,
|
||||||
Window xwindow)
|
Window xwindow)
|
||||||
@ -775,7 +705,6 @@ void
|
|||||||
meta_ui_set_current_theme (const char *name)
|
meta_ui_set_current_theme (const char *name)
|
||||||
{
|
{
|
||||||
meta_theme_set_current (name);
|
meta_theme_set_current (name);
|
||||||
meta_invalidate_default_icons ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
@ -143,9 +143,6 @@ GdkPixbuf* meta_gdk_pixbuf_get_from_pixmap (Pixmap xpixmap,
|
|||||||
int width,
|
int width,
|
||||||
int height);
|
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,
|
gboolean meta_ui_window_should_not_cause_focus (Display *xdisplay,
|
||||||
Window xwindow);
|
Window xwindow);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user