# Difference Between Dwindle, Master, and Monocle Layouts in Hyprland

> Explore the differences between Dwindle, Master, and Monocle layouts in Hyprland. Understand how each tiling algorithm arranges windows to optimize your workflow with this guide.

- Repository: [Hypr Development/Hyprland](https://github.com/hyprwm/Hyprland)
- Tags: deep-dive
- Published: 2026-07-26

---

**Hyprland provides three distinct tiled layout algorithms—Dwindle, Master, and Monocle—that differ fundamentally in window arrangement logic, with Dwindle using recursive binary splits, Master utilizing a dedicated master area with a slave stack, and Monocle displaying only one fullscreen window at a time.**

The **hyprwm/Hyprland** compositor implements these layouts as separate classes under the `src/layout/algorithm/tiled/` directory, each conforming to the common `ITiledAlgorithm` interface. Understanding the difference between Dwindle, Master, and Monocle layouts in Hyprland allows you to optimize workspace organization for coding, browsing, or media consumption workflows.

## How the Layout Algorithms Work

Each layout algorithm manages a list of window targets and calculates their geometries when the workspace state changes. The **[`WorkspaceAlgoMatcher`](https://github.com/hyprwm/Hyprland/blob/main/src/layout/supplementary/WorkspaceAlgoMatcher.cpp)** factory instantiates the appropriate class based on your configuration:

- **`makeUnique<Tiled::CDwindleAlgorithm>()`** for Dwindle
- **`makeUnique<Tiled::CMasterAlgorithm>()`** for Master  
- **`makeUnique<Tiled::CMonocleAlgorithm>()`** for Monocle

All three implement virtual methods such as `newTarget()`, `removeTarget()`, and `recalculate()` to handle window lifecycle events, but they diverge significantly in their spatial logic.

### Dwindle Layout

The **Dwindle** layout creates a binary tree of splits that alternate between horizontal and vertical orientations. When you open a new window, the algorithm divides the currently focused window’s region, toggling the split direction each time to produce a "dwindling" effect.

- **No master-slave hierarchy**: Unlike Master, Dwindle treats every node as an equal split of its parent. While the internal [`SDwindleNodeData`](https://github.com/hyprwm/Hyprland/blob/main/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.hpp) structure may track a master flag for internal bookkeeping, any window can occupy any position in the tree.
- **Recursive subdivision**: The algorithm walks the node tree in [[`DwindleAlgorithm.cpp`](https://github.com/hyprwm/Hyprland/blob/main/DwindleAlgorithm.cpp)](https://github.com/hyprwm/Hyprland/blob/main/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.cpp) to calculate geometries, ensuring space-efficient packing regardless of window count.

### Master Layout

The **Master** layout introduces an explicit **master area** that holds one or more privileged windows, while remaining windows populate a **stack** area. This mirrors classic tiling window manager behavior seen in dwm or i3’s stacked mode.

- **Master node tracking**: The algorithm maintains a designated master via `getMasterNode()` and stores metadata in [`SMasterNodeData`](https://github.com/hyprwm/Hyprland/blob/main/src/layout/algorithm/tiled/master/MasterAlgorithm.hpp), including the **`isMaster`** boolean and **`percMaster`** (the percentage of screen real estate allocated to the master region).
- **Dynamic resizing**: When windows are added, removed, or moved, [[`MasterAlgorithm.cpp`](https://github.com/hyprwm/Hyprland/blob/main/MasterAlgorithm.cpp)](https://github.com/hyprwm/Hyprland/blob/main/src/layout/algorithm/tiled/master/MasterAlgorithm.cpp) adjusts `percMaster` and recalculates stack geometries based on the configured `master_orientation` (left, right, top, or bottom).

### Monocle Layout

The **Monocle** layout maximizes the focused window to fill the entire workspace while keeping other windows hidden in a stack. Switching focus cycles through the stack without resizing or repositioning windows.

- **Single visible target**: The algorithm tracks the currently visible window via `getVisibleTarget()` and updates this pointer when you invoke `cycleNext()` or `cyclePrev()` in [[`MonocleAlgorithm.cpp`](https://github.com/hyprwm/Hyprland/blob/main/MonocleAlgorithm.cpp)](https://github.com/hyprwm/Hyprland/blob/main/src/layout/algorithm/tiled/monocle/MonocleAlgorithm.cpp).
- **No split calculations**: Because windows are never displayed simultaneously, Monocle skips complex geometry calculations and simply sets the active window’s dimensions to match the workspace bounds.

## Configuration Examples

You declare the layout for a workspace in your [`hyprland.conf`](https://github.com/hyprwm/Hyprland/blob/main/hyprland.conf). The **WorkspaceAlgoMatcher** parses these strings during workspace initialization.

### Setting Dwindle for Automatic Tiling

```conf
workspace = 1, layout:dwindle

```

This instantiates a `CDwindleAlgorithm` object that recursively splits windows as they are created.

### Configuring Master with Left-Side Master Area

```conf
workspace = 2, layout:master
master_orientation = left
master_size = 0.55

```

The `CMasterAlgorithm` assigns 55% of the width to the master area (controlled by `percMaster`) and places the stack on the right.

### Enabling Monocle for Fullscreen Workflows

```conf
workspace = 3, layout:monocle

```

With `CMonocleAlgorithm` active, only one window renders at a time. Use key bindings to cycle:

```conf
bind = $mainMod, J, cyclenext
bind = $mainMod, K, cycleprev

```

These trigger `cycleNext()` and `cyclePrev()` to update the visible target.

### Programmatic Layout Switching

Plugins or internal modules can switch layouts dynamically through the layout manager:

```cpp
#include <Hyprland.hpp>
// Switch workspace 1 to Master algorithm
g_pLayoutManager->setLayoutForWorkspace(1, "master");

```

This call routes through `WorkspaceAlgoMatcher` to construct the appropriate algorithm instance.

## Summary

- **Dwindle** recursively alternates horizontal and vertical splits without a master-slave distinction, defined in [[`DwindleAlgorithm.hpp`](https://github.com/hyprwm/Hyprland/blob/main/DwindleAlgorithm.hpp)](https://github.com/hyprwm/Hyprland/blob/main/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.hpp).
- **Master** maintains a dedicated master area using `SMasterNodeData` with `isMaster` flags and `percMaster` sizing, implemented in [[`MasterAlgorithm.cpp`](https://github.com/hyprwm/Hyprland/blob/main/MasterAlgorithm.cpp)](https://github.com/hyprwm/Hyprland/blob/main/src/layout/algorithm/tiled/master/MasterAlgorithm.cpp).
- **Monocle** displays a single fullscreen window via `getVisibleTarget()` and cycles focus with `cycleNext()`, located in [[`MonocleAlgorithm.cpp`](https://github.com/hyprwm/Hyprland/blob/main/MonocleAlgorithm.cpp)](https://github.com/hyprwm/Hyprland/blob/main/src/layout/algorithm/tiled/monocle/MonocleAlgorithm.cpp).
- The **[`WorkspaceAlgoMatcher`](https://github.com/hyprwm/Hyprland/blob/main/src/layout/supplementary/WorkspaceAlgoMatcher.cpp)** maps configuration strings to these concrete implementations using `makeUnique` factory methods.

## Frequently Asked Questions

### How do I switch between Dwindle and Master layouts at runtime?

You can change the layout for the current workspace using the `setlayout` dispatcher or by calling `g_pLayoutManager->setLayoutForWorkspace()` with the string identifier "dwindle", "master", or "monocle". Hyprland immediately destroys the old algorithm instance and constructs the new one, preserving the window list but recalculating all geometries according to the new rules.

### Can I have multiple master windows in the Master layout?

Yes. While the default configuration uses a single master window, the `CMasterAlgorithm` supports multiple masters by adjusting the master count parameter. The `SMasterNodeData` structure tracks which windows have `isMaster` set to true, and the algorithm divides the master area evenly among them before allocating space to the stack.

### Why does Monocle layout hide my windows instead of closing them?

Monocle implements a "stack" metaphor where all windows remain mapped but only the active one receives visibility. The algorithm sets the inactive windows' geometries outside the visible workspace bounds or masks them, allowing instant switching via `cycleNext()` without the overhead of unmapping and remapping buffers. This preserves window state while providing a fullscreen-like experience.

### Which layout consumes the least CPU resources?

**Monocle** typically incurs the lowest computational cost because it skips recursive split calculations and master percentage adjustments. It simply assigns the workspace bounds to one window. **Dwindle** and **Master** require tree traversals or master node calculations on every window addition or removal, though the difference is negligible on modern hardware unless managing hundreds of windows.