# xarblu/kwin-effects-better-blur-dx architecture

> Architecture diagram of the GitHub repository xarblu/kwin-effects-better-blur-dx, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xarblu/kwin-effects-better-blur-dx
- Repository: https://github.com/xarblu/kwin-effects-better-blur-dx

## Overview

Better Blur DX is a KWin/Plasma 6 compositor effect that applies configurable blur behind windows, with force-blur rules, rounded corners, and optional refraction. The main runtime flow is KWin loading the effect, which manages window state and renders blur using cached background data and shader passes; users configure it through the KDE settings module. Edges are limited to relationships shown in excerpts, the source index, or README. Some rendering details and documented bug fixes are not represented as separate stages because their implementations were not sampled.

Main entry points: [`src/blur.cpp`](https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/blur.cpp) (Blur Effect), [`src/window_manager.cpp`](https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/window_manager.cpp) (Window Manager), [`src/blur_cache.cpp`](https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/blur_cache.cpp) (Blur Cache), [`src/rounded_corners_pass.cpp`](https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/rounded_corners_pass.cpp) (Rounded Corners Pass)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["KWin Integration"]
  node_kwin["KWin Compositor"]
  node_effect_entry["Effect Entry<br/>[main.cpp]"]
  node_blur_effect["Blur Effect<br/>[blur.cpp]"]
end

subgraph group_configuration["Configuration"]
  node_config_ui["Settings Module<br/>[blur_config.cpp]"]
  node_config_model["Blur Settings<br/>[settings.hpp]"]
end

subgraph group_window_policy["Window Policy"]
  node_window_manager["Window Manager<br/>[window_manager.cpp]"]
  node_window_state["Window State<br/>[window.cpp]"]
end

subgraph group_rendering["Blur Rendering"]
  node_blur_cache["Blur Cache<br/>[blur_cache.cpp]"]
  node_cache_entry[("Cache Entry<br/>[blur_cache.cpp]")]
  node_refraction["Refraction Pass"]
  node_rounded_corners["Rounded Corners Pass"]
  node_shader_assets["Shader Assets"]
  node_render_utils["Render Utilities<br/>[utils.cpp]"]
end

subgraph group_compatibility["Compatibility"]
  node_compat["KWin Compatibility<br/>[kwin_compat.hpp]"]
end

node_user(("Desktop User"))

node_user -->|"configures"| node_config_ui
node_config_ui -->|"sets options"| node_config_model
node_kwin -->|"loads effect"| node_effect_entry
node_effect_entry -->|"creates"| node_blur_effect
node_kwin -.->|"renders windows"| node_blur_effect
node_blur_effect -->|"manages windows"| node_window_manager
node_window_manager -->|"tracks windows"| node_window_state
node_window_manager -->|"reads options"| node_config_model
node_blur_effect -.->|"configures passes"| node_config_model
node_blur_effect -->|"prepares cache"| node_blur_cache
node_blur_effect -->|"queries policy"| node_window_manager
node_blur_effect -->|"applies refraction"| node_refraction
node_blur_effect -->|"draws corners"| node_rounded_corners
node_blur_effect -->|"uses helpers"| node_render_utils
node_blur_cache -->|"creates and updates"| node_cache_entry
node_blur_cache -->|"delegates drawing"| node_rounded_corners
node_blur_cache -->|"flushes caches"| node_window_manager
node_refraction -->|"uses helpers"| node_render_utils
node_rounded_corners -->|"uses helpers"| node_render_utils
node_blur_effect -.->|"loads shaders"| node_shader_assets
node_refraction -.->|"uses shader assets"| node_shader_assets
node_rounded_corners -.->|"uses shader assets"| node_shader_assets
node_blur_effect -->|"uses compatibility layer"| node_compat
node_window_state -->|"uses compatibility layer"| node_compat

click node_effect_entry "https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/main.cpp"
click node_blur_effect "https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/blur.cpp"
click node_config_ui "https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/kcm/blur_config.cpp"
click node_config_model "https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/settings.hpp"
click node_window_manager "https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/window_manager.cpp"
click node_window_state "https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/window.cpp"
click node_blur_cache "https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/blur_cache.cpp"
click node_cache_entry "https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/blur_cache.cpp"
click node_refraction "https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/refraction_pass.cpp"
click node_rounded_corners "https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/rounded_corners_pass.cpp"
click node_shader_assets "https://github.com/xarblu/kwin-effects-better-blur-dx/tree/main/src/shaders"
click node_render_utils "https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/utils.cpp"
click node_compat "https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/kwin_compat.hpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_kwin,node_effect_entry,node_blur_effect,node_user toneBlue
class node_config_ui,node_config_model toneAmber
class node_window_manager,node_window_state toneMint
class node_blur_cache,node_cache_entry,node_refraction,node_rounded_corners,node_shader_assets,node_render_utils toneRose
class node_compat toneIndigo
```

## Components

### KWin Integration

- **KWin Compositor**
- [Effect Entry](https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/main.cpp): `src/main.cpp`
- [Blur Effect](https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/blur.cpp): `src/blur.cpp`

### Configuration

- [Settings Module](https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/kcm/blur_config.cpp): `src/kcm/blur_config.cpp`
- [Blur Settings](https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/settings.hpp): `src/settings.hpp`

### Window Policy

- [Window Manager](https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/window_manager.cpp): `src/window_manager.cpp`
- [Window State](https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/window.cpp): `src/window.cpp`

### Blur Rendering

- [Blur Cache](https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/blur_cache.cpp): `src/blur_cache.cpp`
- [Cache Entry](https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/blur_cache.cpp): `src/blur_cache.cpp`
- [Refraction Pass](https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/refraction_pass.cpp): `src/refraction_pass.cpp`
- [Rounded Corners Pass](https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/rounded_corners_pass.cpp): `src/rounded_corners_pass.cpp`
- [Shader Assets](https://github.com/xarblu/kwin-effects-better-blur-dx/tree/main/src/shaders): `src/shaders`
- [Render Utilities](https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/utils.cpp): `src/utils.cpp`

### Compatibility

- [KWin Compatibility](https://github.com/xarblu/kwin-effects-better-blur-dx/blob/main/src/kwin_compat.hpp): `src/kwin_compat.hpp`

### Other components

- **Desktop User**

## Connections

- Desktop User → Settings Module: configures (evidence: `README.md`)
- Settings Module → Blur Settings: sets options (evidence: `src/kcm/blur_config.cpp`)
- KWin Compositor → Effect Entry: loads effect (evidence: `src/main.cpp`)
- Effect Entry → Blur Effect: creates (evidence: `src/main.cpp`)
- KWin Compositor → Blur Effect: renders windows (evidence: `README.md`)
- Blur Effect → Window Manager: manages windows
- Window Manager → Window State: tracks windows (evidence: `src/window_manager.cpp`)
- Window Manager → Blur Settings: reads options (evidence: `src/window_manager.cpp`)
- Blur Effect → Blur Settings: configures passes (evidence: `README.md`)
- Blur Effect → Blur Cache: prepares cache (evidence: `src/blur.cpp`)
- Blur Effect → Window Manager: queries policy (evidence: `src/blur.cpp`)
- Blur Effect → Refraction Pass: applies refraction (evidence: `src/blur.cpp`)
- Blur Effect → Rounded Corners Pass: draws corners (evidence: `src/blur.cpp`)
- Blur Effect → Render Utilities: uses helpers (evidence: `src/blur.cpp`)
- Blur Cache → Cache Entry: creates and updates (evidence: `src/blur_cache.cpp`)
- Blur Cache → Rounded Corners Pass: delegates drawing (evidence: `src/blur_cache.cpp`)
- Blur Cache → Window Manager: flushes caches (evidence: `src/blur_cache.cpp`)
- Refraction Pass → Render Utilities: uses helpers (evidence: `src/refraction_pass.cpp`)
- Rounded Corners Pass → Render Utilities: uses helpers (evidence: `src/rounded_corners_pass.cpp`)
- Blur Effect → Shader Assets: loads shaders
- Refraction Pass → Shader Assets: uses shader assets
- Rounded Corners Pass → Shader Assets: uses shader assets
- Blur Effect → KWin Compatibility: uses compatibility layer (evidence: `src/blur.cpp`)
- Window State → KWin Compatibility: uses compatibility layer (evidence: `src/window.cpp`)
