Commit 031154a4 authored by Jasper St. Pierre's avatar Jasper St. Pierre

window-props: Use the standard property type system for WM_WINDOW_ROLE

There seems to be no reason we can't just use this.
parent 463b50e7
......@@ -334,7 +334,9 @@ reload_wm_window_role (MetaWindow *window,
MetaPropValue *value,
gboolean initial)
{
meta_window_x11_update_role (window);
g_clear_pointer (&window->role, g_free);
if (value->type != META_PROP_VALUE_INVALID)
window->role = g_strdup (value->v.str);
}
static void
......@@ -1698,7 +1700,7 @@ meta_display_init_window_prop_hooks (MetaDisplay *display)
{ display->atom__NET_WM_ICON_GEOMETRY, META_PROP_VALUE_CARDINAL_LIST, reload_icon_geometry, FALSE, FALSE },
{ display->atom_WM_CLIENT_LEADER, META_PROP_VALUE_INVALID, complain_about_broken_client, FALSE, FALSE },
{ display->atom_SM_CLIENT_ID, META_PROP_VALUE_INVALID, complain_about_broken_client, FALSE, FALSE },
{ display->atom_WM_WINDOW_ROLE, META_PROP_VALUE_INVALID, reload_wm_window_role, TRUE, FALSE },
{ display->atom_WM_WINDOW_ROLE, META_PROP_VALUE_STRING, reload_wm_window_role, TRUE, FALSE },
{ display->atom__NET_WM_WINDOW_TYPE, META_PROP_VALUE_INVALID, reload_net_wm_window_type, TRUE, TRUE },
{ display->atom__NET_WM_STRUT, META_PROP_VALUE_INVALID, reload_struts, FALSE, FALSE },
{ display->atom__NET_WM_STRUT_PARTIAL, META_PROP_VALUE_INVALID, reload_struts, FALSE, FALSE },
......
......@@ -1658,29 +1658,6 @@ meta_window_x11_update_net_wm_type (MetaWindow *window)
meta_window_x11_recalc_window_type (window);
}
void
meta_window_x11_update_role (MetaWindow *window)
{
char *str;
g_return_if_fail (!window->override_redirect);
if (window->role)
g_free (window->role);
window->role = NULL;
if (meta_prop_get_latin1_string (window->display, window->xwindow,
window->display->atom_WM_WINDOW_ROLE,
&str))
{
window->role = g_strdup (str);
meta_XFree (str);
}
meta_verbose ("Updated role of %s to '%s'\n",
window->desc, window->role ? window->role : "null");
}
static void
meta_window_set_opaque_region (MetaWindow *window,
cairo_region_t *region)
......
......@@ -55,7 +55,6 @@ void meta_window_x11_destroy_sync_request_alarm (MetaWindow *window);
void meta_window_x11_update_sync_request_counter (MetaWindow *window,
gint64 new_counter_value);
void meta_window_x11_update_role (MetaWindow *window);
void meta_window_x11_update_net_wm_type (MetaWindow *window);
void meta_window_x11_update_opaque_region (MetaWindow *window);
void meta_window_x11_update_input_region (MetaWindow *window);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment