Overview
Mango provides 12 built-in layouts for organizing windows automatically. Each layout implements a different arrangement algorithm, and you can assign different layouts to different tags.Available Layouts
Master-Stack Layouts
These layouts divide the screen into a master area and a stack area.Tile (T)
The classic master-stack layout with horizontal split:Vertical Tile (VT)
Master-stack layout with vertical split:Center Tile (CT)
Master in center with stacks on both sides:Right Tile (RT)
Master on the right side:Scroller Layouts
Scrolling layouts where windows can extend beyond screen bounds.Scroller (S)
Horizontal scrolling stack:- Windows can scroll horizontally
- Adjustable window proportions
- Focus-based scrolling
- Ideal for comparing multiple documents side-by-side
Vertical Scroller (VS)
Vertical scrolling stack:Grid Layouts
Evenly distributed window arrangements.Grid (G)
Automatic grid with equal-sized windows:Vertical Grid (VG)
Grid optimized for vertical splitsDeck Layouts
Card-stack style with focus on one window.Deck (K)
Master visible with stack behind:Vertical Deck (VK)
Deck with vertical orientationSpecial Layouts
Monocle (M)
One window at a time, fullscreen:TGMix (TG)
Mixed layout that adapts based on window count:- 1-3 windows: Tile layout
- 4+ windows: Grid layout
Layout Configuration
Switching Layouts
Per-Tag Layout Assignment
Each tag can have a default layout:Master-Stack Settings
Fine-tune master-stack layouts:Resizing Tiled Windows
You can dynamically resize windows in tiling layouts:- Drag window borders with
SUPER + btn_right - Adjusts master/stack proportions
- Changes persist per window
Layout Gaps
Gap Types
- Inner gaps (
gappih,gappiv): Space between windows - Outer gaps (
gappoh,gappov): Space from screen edges
Gap Management
Advanced Layout Features
Per-Client Size Proportions
Mango tracks individual window size preferences:- Windows to maintain relative sizes when layout changes
- Smooth transitions between layouts
- Personalized window sizing
Layout Arrangement Algorithm
Thearrange() function:
-
Pre-calculation (
pre_caculate_before_arrange):- Count visible windows
- Calculate proportions
- Determine master/stack assignments
-
Layout execution:
- Call layout-specific arrange function
- Respect per-client proportions
- Apply gaps and borders
-
Post-processing:
- Update window positions
- Trigger animations
- Refresh status
Dynamic Proportion Adjustment
For tile layouts, you can resize interactively:- Mouse dragging on window borders
- Keyboard-based resizing
- Master/stack ratio adjustment
- Inner proportion changes
Layout-Specific Window Rules
Some window rules interact with layouts:Layout Implementation
Layouts are defined insrc/layout/layout.h:
arrange() function that positions windows according to its algorithm.
Best Practices
Layout Selection
Choose layouts based on task:
- Tile: General multitasking
- Scroller: Document comparison, code review
- Grid: Monitoring, dashboards
- Monocle: Focus work, presentations
- Center Tile: Main task with references
Tag-Layout Pairing
Assign task-appropriate layouts:
Related Concepts
- Tags - Per-tag layout configuration
- Window States - How states interact with layouts
- Animations - Layout transition animations
