mirror of
https://github.com/brl/mutter.git
synced 2024-12-26 12:52:14 +00:00
window: Remove window icon properties
Window icons are X11 specific, and gnome-shell stopped using them even as fallback. Time for some cleanup … Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3452>
This commit is contained in:
parent
7458907360
commit
25d6e4524c
@ -32,8 +32,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <X11/Xutil.h>
|
||||
#include <cairo.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
#include "backends/meta-logical-monitor.h"
|
||||
#include "clutter/clutter.h"
|
||||
@ -583,9 +581,6 @@ struct _MetaWindowClass
|
||||
gboolean *skip_taskbar_out,
|
||||
gboolean *skip_pager_out);
|
||||
|
||||
cairo_surface_t * (*get_icon) (MetaWindow *window);
|
||||
cairo_surface_t * (*get_mini_icon) (MetaWindow *window);
|
||||
|
||||
pid_t (*get_client_pid) (MetaWindow *window);
|
||||
void (*update_main_monitor) (MetaWindow *window,
|
||||
MetaWindowUpdateMonitorFlags flags);
|
||||
@ -830,10 +825,6 @@ MetaLogicalMonitor * meta_window_get_highest_scale_monitor (MetaWindow *window);
|
||||
void meta_window_update_monitor (MetaWindow *window,
|
||||
MetaWindowUpdateMonitorFlags flags);
|
||||
|
||||
cairo_surface_t * meta_window_get_icon (MetaWindow *window);
|
||||
|
||||
cairo_surface_t * meta_window_get_mini_icon (MetaWindow *window);
|
||||
|
||||
void meta_window_set_urgent (MetaWindow *window,
|
||||
gboolean urgent);
|
||||
|
||||
|
@ -186,8 +186,6 @@ enum
|
||||
PROP_0,
|
||||
|
||||
PROP_TITLE,
|
||||
PROP_ICON,
|
||||
PROP_MINI_ICON,
|
||||
PROP_DECORATED,
|
||||
PROP_FULLSCREEN,
|
||||
PROP_MAXIMIZED_HORIZONTALLY,
|
||||
@ -359,12 +357,6 @@ meta_window_get_property(GObject *object,
|
||||
case PROP_TITLE:
|
||||
g_value_set_string (value, win->title);
|
||||
break;
|
||||
case PROP_ICON:
|
||||
g_value_set_pointer (value, meta_window_get_icon (win));
|
||||
break;
|
||||
case PROP_MINI_ICON:
|
||||
g_value_set_pointer (value, meta_window_get_mini_icon (win));
|
||||
break;
|
||||
case PROP_DECORATED:
|
||||
g_value_set_boolean (value, win->decorated);
|
||||
break;
|
||||
@ -499,12 +491,6 @@ meta_window_class_init (MetaWindowClass *klass)
|
||||
g_param_spec_string ("title", NULL, NULL,
|
||||
NULL,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
obj_props[PROP_ICON] =
|
||||
g_param_spec_pointer ("icon", NULL, NULL,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
obj_props[PROP_MINI_ICON] =
|
||||
g_param_spec_pointer ("mini-icon", NULL, NULL,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
obj_props[PROP_DECORATED] =
|
||||
g_param_spec_boolean ("decorated", NULL, NULL,
|
||||
TRUE,
|
||||
@ -5369,28 +5355,6 @@ meta_window_set_icon_geometry (MetaWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
cairo_surface_t *
|
||||
meta_window_get_icon (MetaWindow *window)
|
||||
{
|
||||
MetaWindowClass *klass = META_WINDOW_GET_CLASS (window);
|
||||
|
||||
if (klass->get_icon)
|
||||
return klass->get_icon (window);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cairo_surface_t *
|
||||
meta_window_get_mini_icon (MetaWindow *window)
|
||||
{
|
||||
MetaWindowClass *klass = META_WINDOW_GET_CLASS (window);
|
||||
|
||||
if (klass->get_mini_icon)
|
||||
return klass->get_mini_icon (window);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GList*
|
||||
meta_window_get_workspaces (MetaWindow *window)
|
||||
{
|
||||
|
@ -286,35 +286,6 @@ reload_net_wm_window_type (MetaWindow *window,
|
||||
meta_window_x11_recalc_window_type (window);
|
||||
}
|
||||
|
||||
static void
|
||||
reload_icon (MetaWindow *window,
|
||||
Atom atom)
|
||||
{
|
||||
MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
|
||||
MetaWindowX11Private *priv = meta_window_x11_get_private (window_x11);
|
||||
|
||||
meta_icon_cache_property_changed (&priv->icon_cache,
|
||||
window->display->x11_display,
|
||||
atom);
|
||||
meta_window_x11_queue_update_icon (window_x11);
|
||||
}
|
||||
|
||||
static void
|
||||
reload_net_wm_icon (MetaWindow *window,
|
||||
MetaPropValue *value,
|
||||
gboolean initial)
|
||||
{
|
||||
reload_icon (window, window->display->x11_display->atom__NET_WM_ICON);
|
||||
}
|
||||
|
||||
static void
|
||||
reload_kwm_win_icon (MetaWindow *window,
|
||||
MetaPropValue *value,
|
||||
gboolean initial)
|
||||
{
|
||||
reload_icon (window, window->display->x11_display->atom__KWM_WIN_ICON);
|
||||
}
|
||||
|
||||
static void
|
||||
reload_icon_geometry (MetaWindow *window,
|
||||
MetaPropValue *value,
|
||||
@ -1698,7 +1669,6 @@ reload_wm_hints (MetaWindow *window,
|
||||
window->display->x11_display,
|
||||
XA_WM_HINTS);
|
||||
|
||||
meta_window_x11_queue_update_icon (window_x11);
|
||||
meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
|
||||
}
|
||||
|
||||
@ -1951,8 +1921,6 @@ meta_x11_display_init_window_prop_hooks (MetaX11Display *x11_display)
|
||||
{ x11_display->atom__GTK_MENUBAR_OBJECT_PATH, META_PROP_VALUE_UTF8, reload_gtk_menubar_object_path, LOAD_INIT },
|
||||
{ x11_display->atom__GTK_FRAME_EXTENTS, META_PROP_VALUE_CARDINAL_LIST,reload_gtk_frame_extents, LOAD_INIT },
|
||||
{ x11_display->atom__NET_WM_USER_TIME_WINDOW, META_PROP_VALUE_WINDOW, reload_net_wm_user_time_window, LOAD_INIT },
|
||||
{ x11_display->atom__NET_WM_ICON, META_PROP_VALUE_INVALID, reload_net_wm_icon, NONE },
|
||||
{ x11_display->atom__KWM_WIN_ICON, META_PROP_VALUE_INVALID, reload_kwm_win_icon, NONE },
|
||||
{ x11_display->atom__NET_WM_ICON_GEOMETRY, META_PROP_VALUE_CARDINAL_LIST, reload_icon_geometry, LOAD_INIT },
|
||||
{ x11_display->atom_WM_CLIENT_LEADER, META_PROP_VALUE_INVALID, complain_about_broken_client, NONE },
|
||||
{ x11_display->atom_SM_CLIENT_ID, META_PROP_VALUE_INVALID, complain_about_broken_client, NONE },
|
||||
|
@ -74,10 +74,6 @@ struct _MetaWindowX11Private
|
||||
Pixmap wm_hints_pixmap;
|
||||
Pixmap wm_hints_mask;
|
||||
|
||||
cairo_surface_t *icon;
|
||||
cairo_surface_t *mini_icon;
|
||||
guint update_icon_handle_id;
|
||||
|
||||
/* Freeze/thaw on resize (for Xwayland) */
|
||||
gboolean thaw_after_paint;
|
||||
|
||||
@ -92,8 +88,6 @@ MetaWindowX11Private * meta_window_x11_get_private (MetaWindowX11 *window_x11);
|
||||
void meta_window_x11_set_bypass_compositor_hint (MetaWindowX11 *window_x11,
|
||||
MetaBypassCompositorHint requested_value);
|
||||
|
||||
void meta_window_x11_queue_update_icon (MetaWindowX11 *window_x11);
|
||||
|
||||
void meta_window_x11_initialize_state (MetaWindow *window);
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -1720,87 +1720,6 @@ meta_window_x11_get_default_skip_hints (MetaWindow *window,
|
||||
*skip_pager_out = priv->wm_state_skip_pager;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_x11_update_icon (MetaWindowX11 *window_x11,
|
||||
gboolean force)
|
||||
{
|
||||
MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11);
|
||||
MetaWindow *window = META_WINDOW (window_x11);
|
||||
cairo_surface_t *icon = NULL;
|
||||
cairo_surface_t *mini_icon = NULL;
|
||||
gboolean changed;
|
||||
|
||||
changed = meta_read_icons (window->display->x11_display,
|
||||
window->xwindow,
|
||||
&priv->icon_cache,
|
||||
priv->wm_hints_pixmap,
|
||||
priv->wm_hints_mask,
|
||||
&icon,
|
||||
META_ICON_WIDTH, META_ICON_HEIGHT,
|
||||
&mini_icon,
|
||||
META_MINI_ICON_WIDTH, META_MINI_ICON_HEIGHT);
|
||||
|
||||
if (changed || force)
|
||||
{
|
||||
g_clear_pointer (&priv->icon, cairo_surface_destroy);
|
||||
g_clear_pointer (&priv->mini_icon, cairo_surface_destroy);
|
||||
priv->icon = icon;
|
||||
priv->mini_icon = mini_icon;
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (window));
|
||||
g_object_notify (G_OBJECT (window), "icon");
|
||||
g_object_notify (G_OBJECT (window), "mini-icon");
|
||||
g_object_thaw_notify (G_OBJECT (window));
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
update_icon_before_redraw (gpointer user_data)
|
||||
{
|
||||
MetaWindowX11 *window_x11 = META_WINDOW_X11 (user_data);
|
||||
|
||||
meta_window_x11_update_icon (window_x11, FALSE);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_x11_queue_update_icon (MetaWindowX11 *window_x11)
|
||||
{
|
||||
MetaWindowX11Private *priv =
|
||||
meta_window_x11_get_instance_private (window_x11);
|
||||
MetaWindow *window = META_WINDOW (window_x11);
|
||||
MetaDisplay *display = meta_window_get_display (window);
|
||||
MetaCompositor *compositor = meta_display_get_compositor (display);
|
||||
|
||||
priv->update_icon_handle_id =
|
||||
meta_laters_add (meta_compositor_get_laters (compositor),
|
||||
META_LATER_BEFORE_REDRAW,
|
||||
update_icon_before_redraw,
|
||||
window,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static cairo_surface_t *
|
||||
meta_window_x11_get_icon (MetaWindow *window)
|
||||
{
|
||||
MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
|
||||
MetaWindowX11Private *priv =
|
||||
meta_window_x11_get_instance_private (window_x11);
|
||||
|
||||
return priv->icon;
|
||||
}
|
||||
|
||||
static cairo_surface_t *
|
||||
meta_window_x11_get_mini_icon (MetaWindow *window)
|
||||
{
|
||||
MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
|
||||
MetaWindowX11Private *priv =
|
||||
meta_window_x11_get_instance_private (window_x11);
|
||||
|
||||
return priv->mini_icon;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_x11_update_main_monitor (MetaWindow *window,
|
||||
MetaWindowUpdateMonitorFlags flags)
|
||||
@ -2161,28 +2080,6 @@ meta_window_x11_set_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_x11_dispose (GObject *object)
|
||||
{
|
||||
MetaWindowX11 *window_x11 = META_WINDOW_X11 (object);
|
||||
MetaWindowX11Private *priv =
|
||||
meta_window_x11_get_instance_private (window_x11);
|
||||
MetaWindow *window = META_WINDOW (window_x11);
|
||||
MetaDisplay *display = meta_window_get_display (window);
|
||||
MetaCompositor *compositor = meta_display_get_compositor (display);
|
||||
|
||||
if (priv->update_icon_handle_id)
|
||||
{
|
||||
meta_laters_remove (meta_compositor_get_laters (compositor),
|
||||
priv->update_icon_handle_id);
|
||||
}
|
||||
|
||||
g_clear_pointer (&priv->icon, cairo_surface_destroy);
|
||||
g_clear_pointer (&priv->mini_icon, cairo_surface_destroy);
|
||||
|
||||
G_OBJECT_CLASS (meta_window_x11_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_x11_class_init (MetaWindowX11Class *klass)
|
||||
{
|
||||
@ -2191,7 +2088,6 @@ meta_window_x11_class_init (MetaWindowX11Class *klass)
|
||||
|
||||
object_class->get_property = meta_window_x11_get_property;
|
||||
object_class->set_property = meta_window_x11_set_property;
|
||||
object_class->dispose = meta_window_x11_dispose;
|
||||
object_class->constructed = meta_window_x11_constructed;
|
||||
|
||||
window_class->manage = meta_window_x11_manage;
|
||||
@ -2206,8 +2102,6 @@ meta_window_x11_class_init (MetaWindowX11Class *klass)
|
||||
window_class->move_resize_internal = meta_window_x11_move_resize_internal;
|
||||
window_class->update_struts = meta_window_x11_update_struts;
|
||||
window_class->get_default_skip_hints = meta_window_x11_get_default_skip_hints;
|
||||
window_class->get_icon = meta_window_x11_get_icon;
|
||||
window_class->get_mini_icon = meta_window_x11_get_mini_icon;
|
||||
window_class->update_main_monitor = meta_window_x11_update_main_monitor;
|
||||
window_class->main_monitor_changed = meta_window_x11_main_monitor_changed;
|
||||
window_class->get_client_pid = meta_window_x11_get_client_pid;
|
||||
@ -3796,7 +3690,6 @@ meta_window_x11_new (MetaDisplay *display,
|
||||
MetaX11Display *x11_display = display->x11_display;
|
||||
XWindowAttributes attrs;
|
||||
gulong existing_wm_state;
|
||||
MetaWindowX11 *window_x11;
|
||||
MetaWindow *window = NULL;
|
||||
gulong event_mask;
|
||||
|
||||
@ -3967,11 +3860,6 @@ meta_window_x11_new (MetaDisplay *display,
|
||||
window->placed = TRUE;
|
||||
}
|
||||
|
||||
window_x11 = META_WINDOW_X11 (window);
|
||||
|
||||
if (!window->override_redirect)
|
||||
meta_window_x11_update_icon (window_x11, TRUE);
|
||||
|
||||
meta_window_grab_keys (window);
|
||||
if (window->type != META_WINDOW_DOCK && !window->override_redirect)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user