mirror of
https://github.com/librekeys/gpui-component.git
synced 2026-07-28 08:00:57 -07:00
Add `Root::borderless()` so that layer-shell fullscreen surfaces (greeter, lock screen, screensaver, panel taskbar, etc.) can skip the Linux CSD `window_border` wrapper, which otherwise paints an unwanted border and shadow around an edge-to-edge surface. When `borderless` is set, `Root::render` returns the inner content directly instead of wrapping it in `window_border()`. The default is `false`, so existing behavior is unchanged. ## Description On Linux, `Root::render` always wraps its content in `window_border()` to draw client-side decoration borders and shadows. For layer-shell fullscreen surfaces (greeters, lock screens, screensavers, panels, etc.) this wrapper is undesirable: such surfaces are edge-to-edge and should not have a border or drop shadow around them. This PR adds an opt-in `Root::borderless(bool)` builder method backed by a `borderless: bool` field (default `false`). When `borderless` is `true`, `Root::render` returns the inner content element directly; otherwise it keeps wrapping the content in `window_border().shadow_size(...)` exactly as before. Both branches end with `.into_any_element()` so the return type is unified. Because the default is `false`, all existing windows are unaffected. ## Break Changes None. ## How to Test - `cargo build -p gpui-component` - On Linux with client-side decorations, set `Root::borderless(true)` on a layer-shell fullscreen surface and confirm the border and shadow are no longer drawn around it. - Confirm that a default `Root` (without `borderless`, or `borderless(false)`) still renders the usual border and shadow. ## Checklist - [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and followed the guidelines. - [x] Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate. - [ ] Passed `cargo run` for story tests related to the changes. - [ ] Tested macOS, Windows and Linux platforms performance (if the change is platform-specific) --------- Co-authored-by: Jason Lee <huacnlee@gmail.com>
15 lines
305 B
TOML
15 lines
305 B
TOML
[package]
|
|
name = "root_borderless"
|
|
description = "Example demonstrating disabling Root's window border wrapper."
|
|
version = "0.5.1"
|
|
publish = false
|
|
edition.workspace = true
|
|
|
|
[dependencies]
|
|
gpui.workspace = true
|
|
gpui_platform.workspace = true
|
|
gpui-component = { workspace = true }
|
|
|
|
[lints]
|
|
workspace = true
|