summaryrefslogtreecommitdiff
path: root/src/core/boxes.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2021-04-10 16:37:40 +0200
committerraveit65 <[email protected]>2021-06-07 20:09:03 +0200
commit3ed0ddb242a4804cd7fcfcfcf39a47766eaa816d (patch)
treeb11f566e6c4f90db6a1868c834c6d84ca5dd15a7 /src/core/boxes.c
parent4e4fd6c512423b16640914b33192a32f290b0ef1 (diff)
downloadmarco-3ed0ddb242a4804cd7fcfcfcf39a47766eaa816d.tar.bz2
marco-3ed0ddb242a4804cd7fcfcfcf39a47766eaa816d.tar.xz
window: add support for _GNOME_WM_STRUT_AREA
In addition to existing properties use also new _GNOME_WM_STRUT_AREA property that allows creating struts between monitors. https://mail.gnome.org/archives/wm-spec-list/2018-December/msg00000.html https://gitlab.freedesktop.org/xdg/xdg-specs/merge_requests/22 origin commit: https://gitlab.gnome.org/GNOME/metacity/commit/922de13
Diffstat (limited to 'src/core/boxes.c')
-rw-r--r--src/core/boxes.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/core/boxes.c b/src/core/boxes.c
index 49c82ccc..a9006ede 100644
--- a/src/core/boxes.c
+++ b/src/core/boxes.c
@@ -522,7 +522,9 @@ compare_rect_areas (gconstpointer a, gconstpointer b)
GList*
meta_rectangle_get_minimal_spanning_set_for_region (
const MetaRectangle *basic_rect,
- const GSList *all_struts)
+ const GSList *all_struts,
+ gboolean skip_middle_struts)
+
{
/* NOTE FOR OPTIMIZERS: This function *might* be somewhat slow,
* especially due to the call to merge_spanning_rects_in_region() (which
@@ -583,7 +585,23 @@ meta_rectangle_get_minimal_spanning_set_for_region (
for (strut_iter = all_struts; strut_iter; strut_iter = strut_iter->next)
{
GList *rect_iter;
- MetaRectangle *strut_rect = &((MetaStrut*)strut_iter->data)->rect;
+ MetaStrut *strut = (MetaStrut *) strut_iter->data;
+ MetaRectangle *strut_rect = &strut->rect;
+
+ if (skip_middle_struts && strut->edge == META_EDGE_XINERAMA)
+ {
+ if ((strut->side == META_SIDE_LEFT &&
+ strut_rect->x != basic_rect->x) ||
+ (strut->side == META_SIDE_RIGHT &&
+ strut_rect->x + strut_rect->width != basic_rect->width) ||
+ (strut->side == META_SIDE_TOP &&
+ strut_rect->y != basic_rect->y) ||
+ (strut->side == META_SIDE_BOTTOM &&
+ strut_rect->y + strut_rect->height != basic_rect->height))
+ {
+ continue;
+ }
+ }
tmp_list = ret;
ret = NULL;