Previously, per-monitor margins were applied inside screen_area() itself, which caused unintended side effects on all callers, including _NET_WORKAREA,
window placement, and apps that self-maximize (e.g. Guake dropdown terminal).
Move margin application to the specific call sites that need it:
- client_configure_full(): maximize path (max_horz/max_vert)
- moveresizeto.c run_func(): MoveResizeTo action
- client_find_edge_directional(): per-monitor areas for MoveToEdge
So margins only affect explicit user-initiated maximize and snap actions, while floating windows and app-managed geometry remain unaffected.
Problem
The existing element applies a global strut across the entire desktop. On multi-monitor setups, left/right margins only affect the outermost screen edges, making it impossible to add consistent insets per monitor.
Solution
A new perMonitor attribute on the existing element:
When perMonitor="yes", margins are no longer added as global struts. Instead they are applied per monitor inside screen_area() when a specific monitor head is requested, so they naturally propagate to all consumers:
Maximize (MaximizeFull, MaximizeVert, MaximizeHorz)
Snapping (MoveResizeTo, MoveToEdge)
Not affected: fullscreen windows (screen_physical_area_monitor is used there), floating windows. Panel struts (e.g. Polybar) are respected - they and the margins stack correctly.
The default (perMonitor="no") preserves existing behaviour exactly.
Changes
Testing
Tested with Xephyr (single monitor) and a dual-monitor setup with Polybar strut on the bottom.