Commit 4d9d66da authored by Florian Müllner's avatar Florian Müllner
Browse files

window: Add set_icon_geometry() method

Using a public method for setting the (cached) icon geometry rather
than accessing the struct members directly allows setting the icon
geometry from extensions.

https://bugzilla.gnome.org/show_bug.cgi?id=692997
parent 30bdadb5
......@@ -259,16 +259,19 @@ reload_icon_geometry (MetaWindow *window,
}
else
{
window->icon_geometry.x = (int)value->v.cardinal_list.cardinals[0];
window->icon_geometry.y = (int)value->v.cardinal_list.cardinals[1];
window->icon_geometry.width = (int)value->v.cardinal_list.cardinals[2];
window->icon_geometry.height = (int)value->v.cardinal_list.cardinals[3];
window->icon_geometry_set = TRUE;
MetaRectangle geometry;
geometry.x = (int)value->v.cardinal_list.cardinals[0];
geometry.y = (int)value->v.cardinal_list.cardinals[1];
geometry.width = (int)value->v.cardinal_list.cardinals[2];
geometry.height = (int)value->v.cardinal_list.cardinals[3];
meta_window_set_icon_geometry (window, &geometry);
}
}
else
{
window->icon_geometry_set = FALSE;
meta_window_set_icon_geometry (window, NULL);
}
}
......
......@@ -7172,6 +7172,30 @@ meta_window_get_icon_geometry (MetaWindow *window,
return FALSE;
}
/**
* meta_window_set_icon_geometry:
* @window: a #MetaWindow
* @rect: (allow-none): rectangle with the desired geometry or %NULL.
*
* Sets or unsets the location of the icon corresponding to the window. If
* set, the location should correspond to a dock, task bar or other user
* interface element displaying the icon, and is relative to the root window.
*/
void
meta_window_set_icon_geometry (MetaWindow *window,
MetaRectangle *rect)
{
if (rect)
{
window->icon_geometry = *rect;
window->icon_geometry_set = TRUE;
}
else
{
window->icon_geometry_set = FALSE;
}
}
static Window
read_client_leader (MetaDisplay *display,
Window xwindow)
......
......@@ -149,6 +149,8 @@ gboolean meta_window_is_mapped (MetaWindow *window);
gboolean meta_window_toplevel_is_mapped (MetaWindow *window);
gboolean meta_window_get_icon_geometry (MetaWindow *window,
MetaRectangle *rect);
void meta_window_set_icon_geometry (MetaWindow *window,
MetaRectangle *rect);
void meta_window_maximize (MetaWindow *window,
MetaMaximizeFlags directions);
void meta_window_unmaximize (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