Commit 1ba9ceed authored by Marco Trevisan's avatar Marco Trevisan 🎺

boxes: Add function to check if rectangle has adjacent in region

We might need to check if rectangles region has adjacent neighbors and so in
order to check if there are no blind regions in between monitors.
parent a04ba00b
......@@ -157,6 +157,10 @@ gboolean meta_rectangle_overlaps_with_region (
const GList *spanning_rects,
const MetaRectangle *rect);
gboolean meta_rectangle_has_adjacent_in_region (
const GList *spanning_rects,
const MetaRectangle *rect);
/* Make the rectangle small enough to fit into one of the spanning_rects,
* but make it no smaller than min_size.
*/
......
......@@ -911,6 +911,27 @@ meta_rectangle_overlaps_with_region (const GList *spanning_rects,
return overlaps;
}
gboolean
meta_rectangle_has_adjacent_in_region (const GList *spanning_rects,
const MetaRectangle *rect)
{
const GList *l;
for (l = spanning_rects; l; l = l->next)
{
MetaRectangle *other = (MetaRectangle *) l->data;
if (other == rect)
continue;
if (meta_rectangle_is_adjecent_to ((MetaRectangle *) rect, other))
{
return TRUE;
}
}
return FALSE;
}
void
meta_rectangle_clamp_to_fit_into_region (const GList *spanning_rects,
......
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