Repository navigation
Conversation
…d compositor draws no frame (#591) A Wayland compositor without xdg-decoration (GNOME) draws no window frame, so winit drew its own grey bar above the app's titlebar. A window with App::titlebar now opens without decorations there, and Rune draws its own frame: - the caption buttons the desktop's button-layout names (the settings portal's org.gnome.desktop.wm.preferences, followed while the app runs), as round buttons over the band, at the side the layout names; all three at the right where no portal says; - Cx::chrome_insets reports their room and the band's height; - a 6 point band inside the window's edges resizes it (16 points along each side of a corner), as window_resize elements in Rune's frame around the view, so they show the resize cursors and stay in reach under a modal; - window_drag regions move the window, maximize it on a double click and open the compositor's window menu on a right click, as they already could. X11 and compositors that offer xdg-decoration (KDE, Sway, Hyprland) keep the native frame. RUNE_LINUX_FRAME=0 keeps winit's frame and =1 draws Rune's under any Wayland compositor. The compositor check and the button-layout parsing follow James Ponwith's patch for #993; zce's cut-down of it showed the Windows row layout an app can take from the insets. Co-authored-by: James Ponwith <[email protected]> Co-authored-by: Lei <[email protected]>
Six took more of what the view draws at the window's edge (a scroll bar's thumb) than the two patches this follows, which were tried on GNOME at five.
# Conflicts: # crates/rune/src/runtime/input/titlebar_tests.rs # crates/rune/src/window/host/events.rs
…uttons and tiled sides With Cx::window_actions and Cx::tiled_edges on dev, the frame no longer guesses: a button the window can't act on (maximize on a fixed-size window, minimize where the compositor has none) isn't drawn, as GTK's window controls leave it out, and a side the compositor tiled has no resize band; the band beside it runs to that end.
…w, rounded corners and resize handles Where the Wayland compositor draws no frame, a window with App::titlebar opened without decorations: square, no shadow, resized from a band inside its edges. It now opens with winit's client-side frame less its header bar: the frame's subsurfaces draw the shadow and the one-point border around the window, round all four corners while it floats, and carry the resize handles outside its edges, as a GTK window has them. Rune still draws the caption buttons over the app's titlebar. sctk-adwaita: FrameConfig::headerless. The top part is the bottom part's mirror (it reaches a corner radius into the window and is stacked above the side parts), the side parts start at the window's own top corner, and no title font or button layout is looked up. winit: WindowAttributesExtWayland::with_headerless_frame asks the compositor for client-side decorations and makes that frame in the first configure; WindowExtWayland::has_headerless_frame says whether it exists; the opaque region leaves all four corner squares out. Rune: the corner pass and the CPU frame's clearing take the top two corners as well (render::csd_corners::Rounding), and the band inside the edges is only drawn where no such frame could be made (a borderless window, no subsurfaces, a compositor that keeps its own decorations). Builds on the frame's rounded bottom corners (#1188).
…ass, so its tests run on every platform clear_corners moves from window/linux/cpu_frame.rs to render/csd_corners.rs, beside the pass that does the same to a GPU frame and the Rounding both take; its tests move with it (csd_corners_cpu_tests.rs) and no longer need a Linux build to run.
…rs inside its top corners' arcs too RegionSpec::with_top_corners: the whole-surface blur region's top band is the bottom band's mirror where the client-side frame has no headerbar, so the blur does not show outside the two top arcs the content clears.
dev holds the Linux own frame (#2244) as one commit now: the six files both sides changed take dev's text with this branch's own changes applied over it; the result against dev is this branch's 32 files and nothing else. Docs: the README, the titlebar docs and the first changelog entry say what the window has now.
… window A touch down is a pointer move and a press in one call, with no frame between them: the band is found, at an edge and at a corner, and a touch past it is the view's. No compositor run has sent a touch at the band yet.
|
Real GNOME run of this branch: Fedora 45, GNOME Shell 51.1, mutter 51.1, Wayland, headerless window. The shadow and the rounded corners are there, and the corner radius looks right on this desktop. I haven't checked tiled edges or fractional scaling, so those open questions stand. The 1 pt white line around the window in the screenshot is not this frame — it's I have a fix on The repository won't let me open a PR (only collaborators can), otherwise I would. Would you rather cherry-pick it into this branch, or take it as a separate follow-up? It is based on Before (the white border is the issue above): https://raw.githubusercontent.com/zce/opencode-rune/pr1184-test-shots/1.png |
A window with Rune's own frame on Wayland (#2244) was square, had no shadow, and resized from a band inside its edges. It now has a shadow, a one-point border, four rounded corners and resize handles outside its edges, as a GTK window has. Follow-up of #2244; tracks #591.
How
The window no longer opens without decorations. It keeps the client-side frame the toolkit already draws on GNOME, without its header bar.
flowchart TB subgraph before["#2244: decorations off"] B1[content: square, no shadow] B2[resize band 5 pt INSIDE the edges] end subgraph after["this change: frame without its header bar"] A1[top part: shadow + border + two arcs] A2[left / right parts: shadow + border] A3[bottom part: shadow + border + two arcs] A4[content: cleared outside four arcs] A5[resize handles 12 pt OUTSIDE the edges] end before --> aftervendor/sctk-adwaitaFrameConfig::headerless(). The top part is the bottom part upside down: it reaches a corner radius into the window and is stacked above the side parts. The side parts start at the window's own top corner. No title font and no button layout are looked up.vendor/winitWindowAttributesExtWayland::with_headerless_frameasks the compositor for client-side decorations and makes that frame in the first configure.WindowExtWayland::has_headerless_framesays whether it exists. The opaque region leaves out all four corner squares.runerender::csd_corners::Rounding { radius, top }replaces the bare radius: the GPU pass and the CPU frame's clearing take the top two corners as well, and the whole-surface blur region rounds them.Caption::edgesis empty where that frame exists, so the inside band is not drawn.The inside band of #2244 stays as the fallback where the frame cannot be made: a borderless window, a compositor without subsurfaces, or one that keeps its own decorations.
A maximized, tiled or full-screen window is square with no shadow, as the frame already drew it.
What has run
winit,sctk-adwaitaandrune, with the app. Not built on Linux arm64.dev5342f14d1merged in): 47 test targets ok, none failed; therunelib 3,707 passed, 0 failed, 17 ignored. This branch's own tests passed there: four cleared corners on the GPU (the runner's virtual Metal adapter) and in a CPU frame, the corners a rounding names, no inside band where the frame exists, the blur region's top corners. They have not been compiled or run on Linux or Windows.vendor/sctk-adwaita/src/tests.rs(the top part is the bottom part upside down; a side part's two ends mirror each other). No workflow of this repository tests the vendored crates.Draft until those are in. One thing to settle with it: under mutter, a window tiled to half the screen by the keyboard did not resize from its free edge with #2244's inside band (cause not found yet). Here the handles are the frame's own, outside the edges, so that step must be run again on this branch.
The two vendored crates
vendor/sctk-adwaita(vendor/sctk-adwaita.patch)FrameConfig::headerless(): a frame with no header bar. Its top part is the bottom part's picture upside down, the side parts start at the window's top corner, and no title font or button layout is read.scripts/vendor-sctk-adwaita.sh <version>downloads the published crate and applies the patch, which is one diff from the published crate. A patch that no longer applies fails there and is re-made by hand.vendor/winit(vendor/winit.patch)WindowAttributesExtWayland::with_headerless_frame,WindowExtWayland::has_headerless_frame, client-side decorations asked for such a window, and an opaque region that leaves out all four corner squares.scripts/vendor-winit.sh <version>downloads the published crate and applies the patch. That patch is a list of sections applied in order; this change's section is the last one.Open questions a picture answers
Credit
Builds on the frame's rounded bottom corners (#1188).