# xfce-mirror/xfwm4 architecture

> Architecture diagram of the GitHub repository xfce-mirror/xfwm4, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xfce-mirror/xfwm4
- Repository: https://github.com/xfce-mirror/xfwm4

## Overview

##### Project type and purpose
- This is xfwm4: the C-language window manager for the Xfce desktop. It runs as a single (or multi-threaded) process that communicates with an X server, handles window events, composes window frames, and launches helper dialogs for settings.

##### File structure
- Top-level directories:
- src/          → core C modules (event loop, compositor, window management, input handling, theming, etc.)
- settings-dialogs/ → GUI processes (built with GTK and Glade) for runtime configuration
- helper-dialog/   → small helper utility
- common/       → shared code across modules
- defaults/     → built-in default config files
- po/           → localization files
- Build and config: autogen.sh, configure.ac, meson.build, Makefile.am, meson_options.txt

##### README
- Confirms purpose: “xfwm is the window manager for Xfce.”
- Installation: typical GNU autotools/Meson workflow.

##### Detail is key
- Break “xfwm4 Core” into sub-components to reflect individual src/*.c modules.
- Config directories and theme assets as their own nodes.
- Localization as a separate resource loaded at runtime.

## Diagram (Mermaid)

```mermaid
flowchart TD
    XS["X Server"]:::external

    R["xfwm4 Core Process"]:::core

    subgraph "Core Modules"
        EVI["Event Loop & Input Handler"]:::core
        WM["Window Manager / Frame Renderer"]:::core
        COM["Compositor Module"]:::core
        WMGR["Workspace Manager"]:::core
        THEM["Theme Loader & Icon Manager"]:::core
        SESS["Session & Startup Notification"]:::core
        COMMON["Shared Common Code"]:::core
    end

    subgraph "Helper Processes"
        SD["Settings Dialogs"]:::helper
        HD["Helper Dialog Utility"]:::helper
    end

    subgraph "Configuration & Assets"
        DEF["Defaults (built-in configs)"]:::config
        THI["Themes & Icons"]:::config
    end

    PO["Translations (Localization)"]:::config

    %% Runtime flows
    XS -->|"X events"| R
    R -->|"X requests"| XS

    %% Core to modules
    R --> EVI
    R --> WM
    R --> COM
    R --> WMGR
    R --> THEM
    R --> SESS
    R --> COMMON

    %% Configuration & Assets
    R -->|reads/writes| DEF
    R -->|loads themes/icons| THI
    THEM -->|loads assets| THI

    %% Localization
    R -->|loads .mo files| PO

    %% Helper Processes
    R -->|spawns| SD
    R -->|spawns| HD

    %% Click Events
    click EVI "https://github.com/xfce-mirror/xfwm4/blob/master/src/event_filter.c"
    click EVI "https://github.com/xfce-mirror/xfwm4/blob/master/src/event_filter.h"
    click EVI "https://github.com/xfce-mirror/xfwm4/blob/master/src/events.c"
    click EVI "https://github.com/xfce-mirror/xfwm4/blob/master/src/events.h"
    click WM "https://github.com/xfce-mirror/xfwm4/blob/master/src/frame.c"
    click WM "https://github.com/xfce-mirror/xfwm4/blob/master/src/frame.h"
    click WM "https://github.com/xfce-mirror/xfwm4/blob/master/src/mywindow.c"
    click WM "https://github.com/xfce-mirror/xfwm4/blob/master/src/mywindow.h"
    click COM "https://github.com/xfce-mirror/xfwm4/blob/master/src/compositor.c"
    click COM "https://github.com/xfce-mirror/xfwm4/blob/master/src/compositor.h"
    click WMGR "https://github.com/xfce-mirror/xfwm4/blob/master/src/workspaces.c"
    click WMGR "https://github.com/xfce-mirror/xfwm4/blob/master/src/workspaces.h"
    click WMGR "https://github.com/xfce-mirror/xfwm4/blob/master/src/cycle.c"
    click WMGR "https://github.com/xfce-mirror/xfwm4/blob/master/src/cycle.h"
    click THEM "https://github.com/xfce-mirror/xfwm4/blob/master/src/icons.c"
    click THEM "https://github.com/xfce-mirror/xfwm4/blob/master/src/icons.h"
    click THI "https://github.com/xfce-mirror/xfwm4/tree/master/themes/"
    click THI "https://github.com/xfce-mirror/xfwm4/tree/master/icons/"
    click SESS "https://github.com/xfce-mirror/xfwm4/blob/master/src/session.c"
    click SESS "https://github.com/xfce-mirror/xfwm4/blob/master/src/session.h"
    click SESS "https://github.com/xfce-mirror/xfwm4/blob/master/src/startup_notification.c"
    click SESS "https://github.com/xfce-mirror/xfwm4/blob/master/src/startup_notification.h"
    click PO "https://github.com/xfce-mirror/xfwm4/tree/master/po/"
    click PO "https://github.com/xfce-mirror/xfwm4/blob/master/po/meson.build"
    click SD "https://github.com/xfce-mirror/xfwm4/tree/master/settings-dialogs/"
    click HD "https://github.com/xfce-mirror/xfwm4/blob/master/helper-dialog/helper-dialog.c"
    click HD "https://github.com/xfce-mirror/xfwm4/blob/master/helper-dialog/meson.build"
    click DEF "https://github.com/xfce-mirror/xfwm4/tree/master/defaults/defaults"
    click DEF "https://github.com/xfce-mirror/xfwm4/blob/master/defaults/meson.build"
    click COMMON "https://github.com/xfce-mirror/xfwm4/blob/master/common/xfwm-common.c"
    click COMMON "https://github.com/xfce-mirror/xfwm4/blob/master/common/xfwm-common.h"

    %% Styles
    classDef external fill:#CCCCCC,stroke:#333,stroke-width:1px;
    classDef core fill:#A8D0E6,stroke:#333,stroke-width:1px;
    classDef helper fill:#C3E88D,stroke:#333,stroke-width:1px;
    classDef config fill:#FFE082,stroke:#333,stroke-width:1px;
```
