KWin
KWin is the default window manager and compositor for the KDE Plasma desktop environment on Linux, handling window placement, decorations, switching, and visual effects to provide users with efficient and customizable desktop management.[1][2] Introduced with KDE 2.0 in October 2000, KWin replaced the earlier KWM window manager from KDE 1.x, establishing itself as a stable and mature component of the KDE project with over two decades of continuous development.[3][4] Compositing capabilities, including 3D effects like window animations and desktop switching, were significantly enhanced starting with KDE 4 in 2008, leveraging OpenGL for hardware-accelerated rendering on systems dating back to 2002-era graphics hardware.[1][3] KWin supports both the X11 display server and the modern Wayland protocol, with Wayland integration beginning as a technical preview in Plasma 5.4 in August 2015 and becoming the default session in Plasma 6, released on 28 February 2024, to improve security, performance, and features like partial High Dynamic Range (HDR) support.[5][6] Key features include configurable desktop effects such as Present Windows for overview mode and the Cube desktop switcher, multi-monitor support via the Kephal library, and easy customization through KDE System Settings, ensuring compatibility with low-end hardware by automatically adjusting compositing as needed.[1][2]Overview
Role and Functionality
KWin serves as the window manager for the X Window System and the compositor for Wayland, forming a core component of the KDE Plasma desktop environment.[2][1] It handles the graphical rendering and management of user interfaces within Plasma, ensuring seamless integration with the desktop shell for a cohesive experience.[7] As the default component for window handling in Plasma, KWin has been the default window manager since its introduction in KDE 2.0 in 2000, providing essential services for desktop operation.[3][1] The primary responsibilities of KWin include managing window placement, resizing, focus, and stacking order to organize application interfaces efficiently on the screen.[8][9] It also oversees virtual desktops, allowing users to switch between multiple workspaces and assign windows across them for improved multitasking.[9] Additionally, KWin performs compositing to enable smooth animations, transparency effects, and other visual enhancements that improve the overall desktop fluidity without compromising performance.[1][10] KWin supports multi-monitor configurations through libraries like Kephal, enabling window movement across screens and consistent handling in extended setups.[1] It processes input events, such as keyboard shortcuts like Alt-Tab for switching and mouse gestures for interactions, to facilitate intuitive user control.[8][1] Users can configure KWin's behavior via the System Settings module, which offers options for window rules and effects, while scripting interfaces allow for advanced customizations through JavaScript-based extensions.[1][11]Technical Foundations
KWin supports the X11 protocol as a traditional window manager and compositing manager, primarily integrated with the KDE Plasma desktop environment to handle window placement, resizing, and visual effects for X11-based applications.[12] In this role, KWin interacts directly with the X.Org display server to manage client windows, enforcing extended window manager hints (EWMH/NETWM) for consistent behavior across applications.[13] As a Wayland compositor, KWin implements the Wayland display server protocol to directly manage client surfaces via a Unix socket, bypassing the need for an intermediary like X11 and enabling more secure, efficient rendering.[4] This support has been available since KWin 5.4, allowing native Wayland clients to integrate seamlessly while using XWayland to bridge legacy X11 applications without altering core features like desktop effects or window decorations.[4] KWin is built on the Qt framework, leveraging its cross-platform GUI toolkit for core UI elements, event handling, and rendering pipelines, which ensures compatibility with modern hardware acceleration standards.[13] For declarative scripting and customizable components, such as window decorations and effects, KWin utilizes QML, Qt's declarative language, enabling developers to create dynamic interfaces through JavaScript or QML-based scripts that extend window management behaviors.[11] Examples include QML-based thumbnail rendering in the window switcher and plugins like Plastik for themeable decorations.[13] Integration with KDE libraries enhances KWin's configurability and input management; it employs KConfig for storing and retrieving user settings, such as compositing options and keyboard shortcuts, in a structured, hierarchical format.[13] For device input, KWin incorporates libinput through its backend, particularly in Wayland sessions, to handle touchpads, mice, and keyboards with features like per-device configuration for gestures and button mappings.[14] Since the release of KDE Plasma 6.4, KWin adopts a modular design with separate binaries—kwin_x11 for X11 sessions and kwin_wayland for Wayland—allowing independent maintenance of each backend while supporting co-installation for easy session switching.[15] This separation, implemented by splitting the codebase into distinct repositories, addresses architectural constraints from shared development and focuses resources on Wayland advancements without regressing X11 stability.[15]Development History
Origins in KDE
KWin originated as the window manager for the KDE desktop environment, introduced with KDE 2.0 on October 23, 2000, to replace KWM, which had debuted in KDE 1.0 on July 12, 1998.[16][17][18] Developed collaboratively by the international KDE community, KWin emphasized stability, seamless integration with Qt-based KDE applications, and compliance with emerging X11 standards to enhance usability in a Unix-like desktop.[16] Unlike its predecessor KWM, which struggled with evolving X11 extensions and lacked full support for modern protocols, KWin adopted reparenting techniques to improve window handling, session management, and interoperability with other desktop components.[16][19] In its initial iterations through KDE 3.x, KWin provided core features such as configurable virtual desktops—supporting up to 20 for multitasking—and basic window decorations, exemplified by themes like Plastik introduced in KDE 3.0 for a consistent, customizable aesthetic.[16][20]Introduction of Compositing
The introduction of compositing in KWin marked a significant evolution with the release of KDE 4.0 on January 11, 2008, integrating advanced visual effects directly into the window manager.[21] This update leveraged OpenGL for off-screen rendering, enabling hardware-accelerated window animations and smoother desktop interactions without relying on external compositing managers.[10] As a direct response to the popularity of standalone compositors like Compiz and Beryl, KWin's implementation unified robust window management with eye-catching "bling" effects, allowing KDE users to benefit from enhanced visuals while maintaining the stability of a single, integrated system.[3] Key initial effects included wobbly windows, which simulated jelly-like deformation during window movement; the desktop cube, offering a 3D rotating workspace switcher; and fade transitions for window opening, closing, and switching.[10] These features were designed to add intuitive and engaging visual feedback, such as shadows under windows and dimmed inactive dialogs, enhancing the overall user experience.[21] Users could enable and configure these effects through the KWin settings module, accessible via the window management dialog (Alt+F3), where a simple checkbox toggled compositing on or off, with options to adjust individual effects for customization.[10] However, the shift to compositing introduced performance challenges, particularly on older hardware lacking sufficient GPU support, where OpenGL rendering led to high CPU usage and jerky animations with large windows or multiple effects.[10] To mitigate this, compositing was disabled by default and made fully optional, allowing users to toggle it dynamically with a keyboard shortcut (Shift+Alt+F12).[21] For systems struggling with OpenGL, KWin provided an XRender fallback backend, though it offered fewer features, reduced stability, and poorer performance compared to the primary OpenGL mode.[10]Transition to Frameworks and Wayland
The transition of KWin to KDE Frameworks 5 and Qt 5 began with the release of KWin 5.0 in July 2014, as part of Plasma 5.0, marking a significant modernization effort that replaced the monolithic KDE 4 libraries with modular components designed for better integration with Qt applications.[22] This port enhanced KWin's modularity by leveraging Frameworks 5's tiered architecture, allowing selective use of libraries and reducing dependencies, while Qt 5's improvements in graphics rendering and performance optimization contributed to more efficient compositing and reduced resource usage compared to the Qt 4 era.[23] Parallel to this, KWin introduced experimental support for Wayland in version 4.11, released in August 2013, enabling initial testing of the protocol as a compositor backend while still relying on X11 for client compatibility.[24] This early implementation laid the groundwork for future Wayland adoption, though it remained unstable and non-default. By KWin 5.12 in February 2018, as part of the Plasma 5.12 LTS release, Wayland support had matured considerably, incorporating features like session management and input handling, coinciding with a feature freeze for the X11 backend to redirect development efforts toward Wayland.[25][26] The release of Plasma 6 in February 2024 further advanced KWin's Wayland focus, with version 6.0 providing a stable Wayland session as the default for new installations and emphasizing protocol-specific optimizations. A major architectural change occurred in Plasma 6.4 in June 2025, when KWin's codebase was split into separate kwin_x11 and kwin_wayland binaries, allowing independent maintenance and focused development on each backend without shared code conflicts, while ensuring co-installability for transitional users.[15] This separation extended X11 support through Plasma 7 but prioritized Wayland enhancements, with ongoing releases reaching KWin 6.5.1 in October 2025, delivering bug fixes and stability improvements.[27] Notable updates in this era include the addition of tone mapping in KWin 6.2, released in October 2024, which enables better handling of high dynamic range (HDR) content by compressing bright highlights and preserving color detail on SDR displays, improving visual quality for media playback.[28] In Plasma 6.5 from October 2025, support for multi-plane overlays was introduced in KWin's Wayland backend, utilizing hardware-accelerated planes to offload rendering tasks like video decoding, resulting in significant battery life extensions—up to about 16% during video playback on tested laptops with compatible GPUs—by reducing CPU and GPU workload, as demonstrated in developer benchmarks.[29][30] Subsequent bugfix releases, such as Plasma 6.5.2 on November 4, 2025, continued to deliver stability enhancements.[31]User Experience Features
Window Decorations and Themes
KWin's window decorations provide the visual framing for application windows, including titlebars, borders, and control buttons, enhancing usability and aesthetics in the KDE Plasma desktop environment. The default theme since KDE Plasma 5.1 is Breeze, which succeeded the legacy Oxygen theme used in earlier versions for its improved performance and integration with modern Plasma design principles.[32] Breeze is implemented as a native decoration via the KDecoration2 API, offering a clean, adaptive appearance that aligns with Plasma's overall visual language.[33] Customization of window decorations is facilitated through the Aurorae theme engine, which supports both SVG-based and QML-based themes for flexible rendering of frames and elements.[34] Users can select and configure themes via System Settings, where options include adjusting button layouts, such as the placement of minimize, maximize, and close buttons on the titlebar, which by default are arranged on the right.[35] Shadow rendering is enabled by default in supported themes like Breeze when compositing is active, contributing to depth perception, and can be toggled or modified per theme configuration.[34] Border sizes are adjustable in System Settings for accessibility and preference, with options for extra-wide borders in themes that support it, ensuring visibility and grip areas for resizing.[35] KWin accommodates per-application decorations through window-specific rules, allowing overrides for border thickness or titlebar visibility on individual windows.[35] On Wayland, KWin primarily employs server-side decorations (SSD) for KDE applications to maintain consistency and functionality, while supporting client-side decorations (CSD) from third-party applications via the xdg-decoration protocol.[36][37] Window decorations integrate seamlessly with KDE Plasma's color schemes, inheriting accent and background colors from the active theme to ensure a unified look across the desktop.[38] Font rendering in titlebars follows Plasma's global font settings, providing crisp, scalable text that matches the system's typography choices for readability.[35]Basic Window Management
KWin provides essential operations for manipulating windows through mouse and keyboard interactions. Users can move a window by clicking and dragging its titlebar, allowing repositioning across the screen or to another monitor. To resize a window without relying on border handles, hold the Alt key while clicking and dragging with the left mouse button to move or the right mouse button to adjust dimensions from any point on the window. Right-clicking the titlebar opens a context menu offering actions such as shading (rolling up the window), sticking it to all desktops, maximizing, or minimizing, enabling quick adjustments without navigating system settings.[8] Focus management in KWin supports multiple models to suit user preferences. The default "Click to Focus" model activates a window only upon direct mouse click, preventing unintended activations from mouse movement. "Focus Follows Mouse" automatically shifts focus to the window under the cursor, ideal for keyboard-centric workflows, while "Focus Under Mouse" maintains focus on the hovered window without activating new ones until the mouse moves away. A configurable delay (in milliseconds) can be applied to focus changes to reduce jitter. Additionally, focus stealing prevention operates on levels from None (no restrictions) to Extreme (requiring explicit user activation for all new windows), mitigating disruptions from pop-ups or notifications. On Wayland, since Plasma 6.5, these prevention levels are more effectively enforced using the XDG Activation protocol.[8][39] Keyboard shortcuts facilitate efficient window handling, with defaults emphasizing accessibility. The primary method for switching windows is Alt+Tab, which cycles through open applications; holding Shift reverses the direction. Other defaults include Meta+PgUp to maximize or restore a window and Meta+PgDn to minimize it, while Alt+F3 invokes the full window operations menu for advanced controls. All shortcuts are customizable through the KWin settings in System Settings under Window Management.[40] For multi-desktop environments, KWin's window rules allow precise assignment of applications to specific virtual desktops or activities. Users define rules by matching criteria like window class or title (e.g., forcing the Akregator RSS reader to Desktop 2), with options to apply initially or force permanently, overriding application requests. Rules can also pin windows to all desktops or restrict them to a single activity, supporting workflow separation across virtual spaces. These are configured via the Window Rules dialog, accessible from the titlebar context menu or System Settings.[41]Compositing Capabilities
Rendering Backends
KWin primarily utilizes OpenGL-based rendering backends for hardware-accelerated compositing, supporting multiple versions to accommodate different hardware capabilities. The OpenGL 1.2 backend serves as a basic option for legacy systems, providing essential compositing without advanced shader support. The standard OpenGL 2.0 backend, which requires OpenGL 2.1 compatibility with certain extensions, enables more efficient rendering through the programmable pipeline and is the default for most modern setups. For enhanced performance and features like geometry shaders, the OpenGL 3.1 backend offers advanced capabilities on compatible hardware. Additionally, OpenGL ES 2.0 support targets embedded and mobile platforms, ensuring compatibility with resource-constrained devices.[13] In environments lacking suitable OpenGL support, KWin falls back to the XRender backend, a software-based compositor that relies on the X11 rendering extension for basic window management and effects without hardware acceleration. On Wayland, in the absence of suitable OpenGL support, KWin can use the QPainter backend for software-based compositing. Recent development efforts post-KWin 6.0 have explored Vulkan as a potential modern backend through prototypes, aiming to leverage its low-overhead API for improved control and efficiency in future releases.[42] Backend selection is configurable via theKWIN_COMPOSE environment variable; for instance, setting it to O activates the OpenGL backend (auto-detecting the appropriate version), X enables XRender, and other values like O2 force OpenGL 2.0. Q selects the QPainter backend on Wayland.[43]
To optimize rendering, KWin incorporates VSync support, which synchronizes frame updates with the display refresh rate to eliminate tearing, alongside configurable tear-free rendering modes such as full screen repaints or automatic pipeline adjustments. Efficiency is further enhanced through plane management, utilizing hardware overlay planes to offload compositing tasks from the GPU, reducing power consumption and improving performance in scenarios like video playback.[44]
These backends form the foundation for KWin's effects system, allowing visual enhancements to be rendered efficiently across diverse hardware configurations.
Core Compositing Mechanisms
KWin employs a scene graph-based compositing architecture, where each window surface is rendered off-screen to a texture before being integrated into the overall desktop composition. This approach allows for efficient layering and blending of multiple elements, such as windows, decorations, and overlays, within a unified rendering pipeline. By isolating window rendering to textures, KWin can apply transformations, opacity adjustments, and other operations during the final scene composition without requiring full-screen repaints.[45] In this off-screen rendering process, individual window contents are captured into framebuffer objects or similar off-screen buffers, which are then textured onto quad geometries in the scene graph for compositing. This method supports advanced features like subsurface handling, where child surfaces (e.g., popups or notifications) are rendered separately to their own textures and positioned relative to the parent window using transformation matrices. The resulting textures are blended according to depth ordering and z-values maintained by the workspace scene, ensuring correct occlusion and visual hierarchy across the desktop.[45][46] To optimize performance and minimize computational overhead, KWin implements damage tracking, which identifies only the modified regions of window surfaces since the last frame. This is achieved by leveraging the XDamage extension on X11 or equivalent protocols on Wayland, where applications report changed areas via damage events. KWin then restricts repaints and texture updates to these damaged rectangles, avoiding unnecessary processing of static content and reducing GPU load, particularly in scenarios with frequent partial updates like scrolling or text input. Damage regions are also scaled appropriately during output transformations, such as upscaling for high-DPI displays, to maintain accuracy in multi-resolution setups.[47][48][49] Output management in KWin was historically integrated with the KScreen framework on X11, which handled detection, configuration, and synchronization across multiple displays. In Plasma 6's Wayland session, KWin handles these tasks directly, providing APIs for querying output geometries, refresh rates, and scaling factors, enabling distribution of the composited scene across heterogeneous screens—such as varying resolutions or orientations—without artifacts. For instance, when multiple monitors are connected, KWin assigns scene views per output, applying per-screen transformations like panning or mirroring while synchronizing frame timings to the lowest common refresh rate for tear-free rendering. This ensures seamless handling of hotplug events, where outputs are dynamically added or removed, with the compositor reallocating windows and repainting only affected areas.[50][51] Significant latency reductions were introduced through an extensive rewrite of KWin's compositing core in Plasma 5.21, released in February 2021, building on prior improvements from Plasma 5.20, with further refinements in subsequent releases. This refactoring streamlined the rendering pipeline by decoupling scene updates from blocking I/O operations and optimizing texture uploads, resulting in sub-frame delays for window manipulations and animations. The changes reduced overall compositing latency by prioritizing asynchronous operations and better scheduling, making interactions feel more responsive even on modest hardware.[52] In 2025, KWin enhanced efficiency with multi-plane support in its DRM backend, leveraging hardware planes for direct scanout of independent layers like cursors or video content. This allows multiple overlays to bypass full compositing on the GPU, conserving power by offloading static elements to dedicated planes—particularly beneficial for battery life on laptops with hybrid graphics. For example, cursor rendering now avoids the primary plane on secondary outputs, preventing redundant computations across multi-monitor setups. These advancements build on the underlying rendering hardware capabilities without altering the core algorithmic flow.[53]Effects System
Accessibility Enhancements
KWin's accessibility enhancements primarily consist of compositing effects tailored to support users with visual and motor impairments, leveraging the window manager's rendering capabilities to improve usability without compromising performance. The Zoom effect enables on-demand screen magnification, allowing users to enlarge specific areas of the desktop for better readability. Activated via configurable keyboard shortcuts, with common defaults being Ctrl + + for zooming in and Ctrl + - for zooming out, or by holding Ctrl while scrolling the mouse wheel,[54] it supports smooth panning to navigate magnified content, making it essential for individuals with low vision. This effect operates by scaling the rendered scene in real-time, ensuring fluid interaction during magnification.[55] Complementing visual aids, the Invert effect inverts all screen colors instantaneously, providing high contrast for users with color vision deficiencies or light sensitivity. By applying a color matrix transformation to the entire composited output, it reverses luminance and hue across the desktop, facilitating prolonged use in low-light environments or for those requiring enhanced edge detection in interfaces.[3] For motor-impaired navigation, KWin integrates with KDE's KMouseTool, which simulates mouse clicks by monitoring cursor dwell time and position, eliminating the need for physical button presses. This tool tracks mouse movement and automatically triggers left, right, or double-click actions after a configurable pause, aiding users with limited dexterity while maintaining compatibility with KWin's input handling.[56] Additionally, KWin supports high-contrast window decorations and prominent outline focus indicators, which draw bold borders around active windows and highlight keyboard-focused elements with increased thickness and color saturation. These features align with KDE's broader accessibility framework, including high-contrast color schemes that propagate to decorations for consistent visibility across the desktop environment.[57][58]Visual and Focus Effects
KWin provides a range of visual effects that enhance the desktop's appearance through decorative elements such as blurring and transparency. The Blur effect applies a Gaussian blur to background windows or specific areas, particularly noticeable behind menus and popups, creating depth and reducing visual clutter. In Plasma 6, the Blur effect has been rewritten for better reliability and performance, especially on Wayland sessions.[59] Translucency allows windows to become partially transparent under certain conditions, such as when inactive or during specific interactions, contributing to a layered aesthetic. These appearance effects are implemented via shader-based rendering in KWin's compositing engine.[60] Focus effects in KWin emphasize the active window to improve user interaction feedback. The Dim Inactive effect reduces the brightness of non-focused windows, making the current one stand out more prominently. The Outline effect displays a temporary outline preview of the window's geometry during resizing or moving operations, assisting with precise placement.[61] The Fade effect smoothly transitions window opacity during focus shifts, with in/out animations that last fractions of a second for subtle feedback. Additionally, the Present Windows effect arranges windows in a scaled overview mode, useful for quick navigation and focus selection in multi-window scenarios. These effects rely on KWin's scene graph for efficient rendering.[62][60] For playful or "candy" effects, KWin includes whimsical animations that add entertainment without essential functionality. Wobbly Windows simulates a jelly-like deformation when dragging windows, with adjustable wobble intensity for varying degrees of motion. The Magic Lamp effect animates window minimization by folding and rolling it like a genie's lamp, while restoration reverses the motion. These are optional and can overlap briefly with accessibility features like zoom for enhanced visibility.[62] All visual and focus effects can be toggled individually through System Settings under the Desktop Effects module, where users enable or disable them via checkboxes and adjust parameters like duration or intensity where applicable. Some effects, such as Blur and Wobbly Windows, may introduce minor performance overhead on lower-end hardware due to additional GPU computations, though KWin optimizes them for modern rendering backends; testing on specific systems is recommended to balance aesthetics and responsiveness.[62][63]Advanced Management
Tiling and Virtual Desktops
KWin provides built-in support for window tiling, allowing users to automatically arrange windows into predefined or custom layouts to optimize screen space without manual resizing. The core tiling mechanism includes quick snapping features activated by keyboard shortcuts, such as Meta + Arrow keys, which resize and position the active window to halves, quarters, or thirds of the screen edges and corners.[64] For more advanced arrangements, Plasma 6 introduces a custom tiling editor accessible via Meta + T, enabling users to define tile areas, load presets, adjust gaps between tiles, and resize layouts dynamically with keyboard input.[65] This system supports a toggle between floating (traditional free-placement) and tiling modes, configurable in system settings to enforce automated layouts globally or per window.[66] Additionally, community-developed scripts inspired by tiling window managers like bspwm, such as Krohnkite or Bismuth, extend KWin's capabilities for dynamic, rule-based tiling and are available through the KDE Store.[67] Virtual desktops in KWin enable multitasking by extending the workspace across multiple independent screens, with a configurable limit of up to 20 desktops per activity to prevent performance overhead.[68] Users can switch desktops using shortcuts like Ctrl + F1 through Ctrl + F4 or a desktop grid view via Meta + F8, and assign unique names or icons to each for easy identification.[69] Wallpapers are applied per activity rather than per individual virtual desktop, allowing consistent theming across desktops within a task-focused group, though scripts can simulate per-desktop customization.[70] The Present Windows overview, toggled by default with Ctrl + F9, displays all open windows on the current desktop in a grid for quick selection and navigation, enhancing workflow across desktops.[40] KWin integrates virtual desktops with KDE Activities, which serve as containers for grouping related desktops and widgets by task, such as work or personal use, to create isolated environments without duplicating hardware resources.[71] Window rules allow automatic placement of applications to specific virtual desktops or activities based on criteria like window class or title, ensuring consistent organization—for instance, routing a web browser to a "research" activity's desktop one.[41] Starting with Plasma 6.3, KWin includes better activity-aware desktop tracking, preserving the current virtual desktop position when switching activities.[72] In an upcoming Plasma 6.6 release (as of November 2025), options to limit virtual desktops to the primary monitor for multi-monitor setups have been implemented.[73]Scripting and Customization
KWin provides extensibility through its scripting API, which allows users and developers to customize window management behaviors, effects, and rules using JavaScript (based on QtScript in Plasma 5 and ECM's JavaScriptEngine in Plasma 6) or QML for declarative scripts (supported since earlier Plasma versions but enhanced in Plasma 5).[11] Note that Plasma 6 introduced breaking changes to the KWin scripting API, making some Plasma 5 scripts incompatible.[74] This API enables the creation of effects that alter window animations, opacity, or positioning, as well as rules for automating window properties, with core access provided through classes likeKWin::Workspace for managing windows and KWin::EffectsHandler for visual modifications.[75] In KDE Plasma 6.0 and later, QML scripting has been emphasized for improved performance and compatibility with Qt 6, facilitating smoother integration of declarative UI elements and reducing overhead compared to traditional JavaScript scripts.[11]
Scripts are typically developed using the Plasma Desktop Scripting Console for testing, with packaging handled via the KPackage framework, and can be installed directly through System Settings under Window Management > KWin Scripts by selecting "Get New Scripts" from the KDE Store.[11] Popular examples include the "Force Blur" script, which applies the blur effect to windows that do not natively support it, such as certain applications lacking proper compositor hints, and tiling extensions like "Exquisite" that enable custom window grouping and snapping behaviors beyond native tools.[76][77] Once installed, scripts can be enabled, configured, or disabled via the same System Settings interface, with changes applied by restarting KWin or using commands like qdbus org.kde.KWin /KWin reconfigure.[11]
Window rules offer a non-scripting method for advanced customization, allowing users to match specific windows based on criteria such as WM_CLASS (application identifier), window title (using exact, substring, or regular expression matching), or window role (e.g., distinguishing dialog from main windows).[41] These rules can enforce behaviors like setting a window to always-on-top by applying the "Keep above" attribute with a "Force" parameter, ensuring consistent placement regardless of user actions or focus changes.[41] Configuration occurs primarily through System Settings > Window Behavior > Window Rules, where users detect properties via "Detect Window Properties" and apply rules selectively, though manual editing is possible in the ~/.config/kwinrc file under sections like [Windows] for persistent tweaks.[41]
Overall, KWin's scripting and customization options balance accessibility for end-users with powerful tools for developers, supporting both imperative JavaScript for complex logic and declarative QML for efficient, modern extensions in recent Plasma versions.[11]