window_layouter: protect against mode 1 x 1

This patch handles intermediate situations where the screen mode may
become 1 x 1 (absence of any capture clients). In this case, the
decoration of a maximized window would legitimately exceed the screen
boundary.

Thanks Johannes for the investigation.

Issue #5187
Issue #5180
This commit is contained in:
Norman Feske 2024-04-23 14:41:26 +02:00 committed by Christian Helmuth
parent 0f0fa5b2a2
commit b939358c36

View File

@ -37,6 +37,9 @@ struct Window_layouter::Decorator_margins
*/
Rect inner_geometry(Rect outer) const
{
/* enforce assumption that outer must be larger than the decorations */
outer = Rect::compound(outer, { outer.p1(), Area { left + right + 1,
top + bottom + 1 } });
return Rect(outer.p1() + Point(left, top),
outer.p2() - Point(right, bottom));
}