summaryrefslogtreecommitdiff
path: root/src/core/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/window.c')
-rw-r--r--src/core/window.c88
1 files changed, 88 insertions, 0 deletions
diff --git a/src/core/window.c b/src/core/window.c
index add00789..55badf54 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -6240,6 +6240,91 @@ meta_window_update_struts (MetaWindow *window)
if (meta_prop_get_cardinal_list (window->display,
window->xwindow,
+ window->display->atom__GNOME_WM_STRUT_AREA,
+ &struts, &nitems))
+ {
+ if (nitems != 4)
+ {
+ meta_verbose ("_GNOME_WM_STRUT_AREA on %s has %d values instead of 4\n",
+ window->desc, nitems);
+ }
+ else
+ {
+ MetaStrut *temp;
+ MetaSide side;
+ gboolean valid;
+ int i;
+
+ temp = g_new (MetaStrut, 1);
+
+ temp->rect.x = struts[0];
+ temp->rect.y = struts[1];
+ temp->rect.width = struts[2];
+ temp->rect.height = struts[3];
+
+ side = META_SIDE_LEFT;
+ valid = FALSE;
+
+ for (i = 0; i < window->screen->n_xinerama_infos; i++)
+ {
+ MetaRectangle monitor;
+
+ monitor = window->screen->xinerama_infos[i].rect;
+ if (!meta_rectangle_contains_rect (&monitor, &temp->rect))
+ continue;
+
+ if (temp->rect.height > temp->rect.width)
+ {
+ if (temp->rect.x == monitor.x)
+ {
+ side = META_SIDE_LEFT;
+ valid = TRUE;
+ }
+ else if (temp->rect.x + temp->rect.width == monitor.x + monitor.width)
+ {
+ side = META_SIDE_RIGHT;
+ valid = TRUE;
+ }
+ }
+ else
+ {
+ if (temp->rect.y == monitor.y)
+ {
+ side = META_SIDE_TOP;
+ valid = TRUE;
+ }
+ else if (temp->rect.y + temp->rect.height == monitor.y + monitor.height)
+ {
+ side = META_SIDE_BOTTOM;
+ valid = TRUE;
+ }
+ }
+ }
+
+ if (valid)
+ {
+ temp->side = side;
+ temp->edge = META_EDGE_XINERAMA;
+
+ new_struts = g_slist_prepend (new_struts, temp);
+ }
+ else
+ {
+ g_free (temp);
+ }
+ }
+
+ meta_XFree (struts);
+ }
+ else
+ {
+ meta_verbose ("No _GNOME_WM_STRUT_AREA property for %s\n",
+ window->desc);
+ }
+
+ if (!new_struts &&
+ meta_prop_get_cardinal_list (window->display,
+ window->xwindow,
window->display->atom__NET_WM_STRUT_PARTIAL,
&struts, &nitems))
{
@@ -6264,6 +6349,7 @@ meta_window_update_struts (MetaWindow *window)
temp = g_new (MetaStrut, 1);
temp->side = 1 << i; /* See MetaSide def. Matches nicely, eh? */
+ temp->edge = META_EDGE_SCREEN;
temp->rect = window->screen->rect;
switch (temp->side)
{
@@ -6327,6 +6413,7 @@ meta_window_update_struts (MetaWindow *window)
temp = g_new (MetaStrut, 1);
temp->side = 1 << i;
+ temp->edge = META_EDGE_SCREEN;
temp->rect = window->screen->rect;
switch (temp->side)
{
@@ -6370,6 +6457,7 @@ meta_window_update_struts (MetaWindow *window)
MetaStrut *new_strut = (MetaStrut*) new_iter->data;
if (old_strut->side != new_strut->side ||
+ old_strut->edge != new_strut->edge ||
!meta_rectangle_equal (&old_strut->rect, &new_strut->rect))
break;