# matinlotfali/kde-rounded-corners architecture

> Architecture diagram of the GitHub repository matinlotfali/kde-rounded-corners, 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/matinlotfali/kde-rounded-corners
- Repository: https://github.com/matinlotfali/kde-rounded-corners

## Overview

KDE-Rounded-Corners is a KWin effect that rounds window corners and draws configurable outlines. The main runtime path is KWin invoking the effect, which manages window state and renders windows through a custom shader; users can configure appearance through the KDE Control Module. Window tracking also checks tiling and maximization, while animation transitions window appearance. The source index and excerpts support the main effect/rendering relationships; shader-file wiring and some configuration internals are not fully shown, so those links are omitted or marked unverified.

Main entry points: [`src/Effect.cpp`](https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/Effect.cpp) (Rounded-corners effect), [`src/WindowManager.cpp`](https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/WindowManager.cpp) (Window manager), [`src/Shader.cpp`](https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/Shader.cpp) (Shader manager), [`src/Window.cpp`](https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/Window.cpp) (Window state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["KWin integration"]
  node_effect_plugin["Effect plugin<br/>[plugin.cpp]"]
  node_effect["Rounded-corners effect<br/>[Effect.cpp]"]
end

subgraph group_rendering["Window rendering"]
  node_shader_manager["Shader manager<br/>[Shader.cpp]"]
  node_shader_sources["Corner and outline shaders"]
end

subgraph group_window_state["Window state"]
  node_window_manager["Window manager<br/>[WindowManager.cpp]"]
  node_window["Window state<br/>[Window.cpp]"]
  node_tile_checker["Tile checker<br/>[TileChecker.cpp]"]
  node_animation["Appearance animation<br/>[Animation.cpp]"]
end

subgraph group_configuration["Configuration"]
  node_window_config["Window appearance config<br/>[WindowConfig.cpp]"]
  node_settings_ui["KDE settings module<br/>[KCM.cpp]"]
  node_breeze_config["Breeze configuration<br/>[Effect.cpp]"]
end

node_user(("Desktop user"))
node_kwin["KWin compositor"]
node_dbus_client(("D-Bus client"))

node_kwin -->|"loads effect"| node_effect_plugin
node_effect -->|"manages windows"| node_window_manager
node_effect -->|"updates animation"| node_animation
node_effect -->|"binds shader"| node_shader_manager
node_effect -->|"checks window state"| node_window
node_window_manager -->|"checks tiling"| node_tile_checker
node_window_manager -->|"tracks windows"| node_window
node_animation -->|"updates appearance"| node_window
node_shader_manager -->|"reads appearance"| node_window_config
node_shader_manager -.->|"loads shaders"| node_shader_sources
node_user -->|"configures effect"| node_settings_ui
node_settings_ui -.->|"saves settings"| node_window_config
node_effect -->|"writes config"| node_breeze_config
node_dbus_client -.->|"queries windows"| node_window_manager

click node_effect_plugin "https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/plugin.cpp"
click node_effect "https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/Effect.cpp"
click node_window_manager "https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/WindowManager.cpp"
click node_window "https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/Window.cpp"
click node_tile_checker "https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/TileChecker.cpp"
click node_animation "https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/Animation.cpp"
click node_window_config "https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/WindowConfig.cpp"
click node_settings_ui "https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/kcm/KCM.cpp"
click node_shader_manager "https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/Shader.cpp"
click node_shader_sources "https://github.com/matinlotfali/kde-rounded-corners/tree/master/src/shaders"
click node_breeze_config "https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/Effect.cpp"

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_effect_plugin,node_effect,node_user,node_dbus_client toneBlue
class node_shader_manager,node_shader_sources toneAmber
class node_window_manager,node_window,node_tile_checker,node_animation toneMint
class node_window_config,node_settings_ui,node_breeze_config toneRose
class node_kwin toneIndigo
```

## Components

### KWin integration

- [Effect plugin](https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/plugin.cpp): `src/plugin.cpp`
- [Rounded-corners effect](https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/Effect.cpp): `src/Effect.cpp`

### Window rendering

- [Shader manager](https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/Shader.cpp): `src/Shader.cpp`
- [Corner and outline shaders](https://github.com/matinlotfali/kde-rounded-corners/tree/master/src/shaders): `src/shaders`

### Window state

- [Window manager](https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/WindowManager.cpp): `src/WindowManager.cpp`
- [Window state](https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/Window.cpp): `src/Window.cpp`
- [Tile checker](https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/TileChecker.cpp): `src/TileChecker.cpp`
- [Appearance animation](https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/Animation.cpp): `src/Animation.cpp`

### Configuration

- [Window appearance config](https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/WindowConfig.cpp): `src/WindowConfig.cpp`
- [KDE settings module](https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/kcm/KCM.cpp): `src/kcm/KCM.cpp`
- [Breeze configuration](https://github.com/matinlotfali/kde-rounded-corners/blob/master/src/Effect.cpp): `src/Effect.cpp`

### Other components

- **Desktop user**
- **KWin compositor**
- **D-Bus client**

## Connections

- KWin compositor → Effect plugin: loads effect (evidence: `src/plugin.cpp`)
- Rounded-corners effect → Window manager: manages windows (evidence: `src/Effect.cpp`)
- Rounded-corners effect → Appearance animation: updates animation (evidence: `src/Effect.cpp`)
- Rounded-corners effect → Shader manager: binds shader (evidence: `src/Effect.cpp`)
- Rounded-corners effect → Window state: checks window state (evidence: `src/Effect.cpp`)
- Window manager → Tile checker: checks tiling (evidence: `src/WindowManager.cpp`)
- Window manager → Window state: tracks windows (evidence: `src/WindowManager.cpp`)
- Appearance animation → Window state: updates appearance (evidence: `src/Animation.cpp`)
- Shader manager → Window appearance config: reads appearance (evidence: `src/Shader.cpp`)
- Shader manager → Corner and outline shaders: loads shaders
- Desktop user → KDE settings module: configures effect
- KDE settings module → Window appearance config: saves settings
- Rounded-corners effect → Breeze configuration: writes config (evidence: `src/Effect.cpp`)
- D-Bus client → Window manager: queries windows
