Project Structure
The project is organized into several key directories:Technologies Used
Core Technologies
- C++23: Modern C++ standard for the codebase
- Qt 6: GUI framework (minimum version 6.6.0)
- Qt6Core, Qt6DBus, Qt6Gui, Qt6OpenGL, Qt6Quick, Qt6Widgets
- KDE Frameworks 6 (KF6): KDE libraries (minimum version 5.240.0)
- KColorScheme, KConfig, KConfigWidgets, KCoreAddons
- KI18n, KCMUtils, KWidgetsAddons, KWindowSystem
- KWin: Plasma window manager development libraries
- KDecoration3: Window decoration framework
Graphics
- OpenGL: GPU-accelerated rendering via libepoxy
- GLSL: OpenGL Shading Language for shader programs
Build System
- CMake: Build system (minimum version 3.16.0)
- Extra CMake Modules (ECM): KDE CMake extensions
- CPack: Package generation for distributions
Key Components
Better Blur DX is built around several core components that work together to provide advanced blur effects:BlurEffect (blur.h, blur.cpp)
The main effect class that inherits fromKWin::Effect. This is the entry point for the blur effect and coordinates all other components.
Key responsibilities:
- Screen and window pre-paint operations
- Window drawing with blur applied
- Managing blur regions for windows
- Dual Kawase blur algorithm implementation
- Downsample and upsample passes
- Color matrix transformations (brightness, contrast, saturation)
- Integration with KWin effect system
BlurRenderData: Temporary render targets and framebuffers for the blur algorithmBlurEffectData: Per-window blur data including regions, render data, and color matrices
src/blur.h:75.
WindowManager (window_manager.hpp, window_manager.cpp)
Manages all windows that the blur effect applies to, including window classification and state tracking. Key responsibilities:- Window lifecycle management (add/delete)
- Window class matching (whitelist/blacklist with regex support)
- Maximized state detection and tracking
- Dock window handling
- Blur region calculation and updates
- Border radius management
- Transform state tracking (for animations)
- Window class filtering (fixed strings and regex patterns)
- Decoration, dock, and menu blur toggles
- User-configured border radius
src/window_manager.hpp:32.
RefractionPass (refraction_pass.hpp, refraction_pass.cpp)
Implements the refraction effect that simulates light bending at window edges. Key features:- Rectangular and rounded corner variants
- Configurable edge size and corner radius
- RGB fringing simulation
- Normal power adjustment
- Multiple texture repeat modes
- Adjustable refraction strength
- MVP matrix and color matrix
- Offset and halfpixel parameters
- Refraction-specific parameters (strength, edge size, corner radius, etc.)
src/refraction_pass.hpp:14.
RoundedCornersPass (rounded_corners_pass.hpp, rounded_corners_pass.cpp)
Applies rounded corners to blurred windows by masking with the un-blurred background. Key features:- Shader-based corner rounding
- Per-corner radius support
- Integration with blur render pipeline
- Vertex buffer optimization
- Uses the first framebuffer containing raw un-blurred pixels
- Applies rounded corner mask based on corner radius
- Renders with proper viewport and window transformations
src/rounded_corners_pass.hpp:23.
Window (window.hpp, window.cpp)
Represents an individual managed window with blur state and properties. Tracked properties:- Blur regions (content and frame)
- Maximized state
- Transform state (for animations)
- Effective border radius
- Blur opacity
Settings (settings.h, settings.cpp, blur.kcfg)
Configuration management using KConfig system. Configuration file:src/blur.kcfg defines all user-configurable options including:
- Blur strength and iterations
- Brightness, contrast, saturation adjustments
- Corner radius
- Refraction parameters
- Window class filters
- Noise texture settings
Shader Pipeline
The effect uses multiple GLSL shader programs located insrc/shaders/:
Blur Shaders
downsample.frag/downsample_core.frag- Downsampling passupsample.frag/upsample_core.frag- Upsampling passnoise.frag/noise_core.frag- Noise texture generation
Onscreen Rendering
onscreen.frag/onscreen_core.frag- Standard rectangular blur renderingonscreen_rounded.frag/onscreen_rounded.vert- Rounded corner blur renderingonscreen_rounded_core.frag/onscreen_rounded_core.vert- Core profile version
Refraction Effects
refraction.frag/refraction_core.frag- Rectangular refractionrefraction_rounded.frag/refraction_rounded_core.frag- Rounded refraction
Rounded Corners
rounded_corners.frag/rounded_corners.vert- Rounded corner maskrounded_corners_core.frag/rounded_corners_core.vert- Core profile version
KCM Module
The KConfig Module (src/kcm/) provides the settings UI in System Settings:
blur_config.cpp/blur_config.h- Configuration dialog implementationblur_config.ui- Qt Designer UI fileabout.html- About page content
Platform Support
Wayland (Primary)
Full support for KWin Wayland with all features enabled by default.X11 (Limited)
X11 support is available but considered deprecated and requires explicit opt-in during build with-DBETTERBLUR_X11=ON. The X11 and Wayland versions are diverging as KWin X11 receives fewer API updates.
Version Compatibility
The effect is designed to work with Plasma 6.5 and 6.6. It includes compatibility shims for API differences:kwin_version.hpp- Version detection macroskwin_compat_6_5.hpp- Compatibility layer for Plasma 6.5