Repository navigation
v0.1.22
The window chrome a platform without a titlebar hands over: a frame where the compositor draws none, caption buttons where the desktop puts them, and a bar that drags by its grip.
New
ui::window::framewraps an app's root in the frame its window owes — a border,Theme::surface_radiuscorners, a shadow, and aTheme::CLIENT_INSETband that resizes from all eight directions. It readsWindow::window_decorationsper frame: underDecorations::Serverthe child comes back untouched, which is macOS, Windows, X11 and KDE. GNOME's Wayland session has never implementedxdg-decorationand answersClientwhatever was asked for, and that is the case this paints. An edgetilingreports flush keeps its square corner and gives up its band.ui::window::resize_edgeis which edge a press resizes, orNonefor a press on the content. The corners take theirinsetsquare and the edges take what is left between them, so the hitboxes the frame lays down need no order between them.titlebar::controlsis the caption cluster off macOS — minimize, maximize or restore, and close. Call it at both ends of the bar withCaptionSideand the desktop decides which end fills:App::button_layoutreads GNOME'sgtk-decoration-layout, and a platform reporting no layout puts the three on the right. Empty in full screen, and short whateverWindow::window_controlssays the compositor refuses.titlebar::gripis the bare stretch of a bar that moves its window, zooms it on a double click and opens the desktop's window menu on a right press. It takes the free space the content leaves.keys::printedwrites a chord nothing is bound to the way the platform writes it —secondary-sis⌘SagainstCtrl+S, whilecmd-s,super-sandwin-sname the platform key itself and print⌘SagainstWin+S. For a label naming a chord the keymap does not own; where there is a binding,keys::shortcutcannot drift and this can.Theme::CLIENT_INSETis the band a client-decorated window keeps outside its content, andTheme::CAPTION_BUTTON_WIDTHone caption button.ui::statsreads CPU time and memory on Windows, throughGetProcessTimesandGetProcessMemoryInfo. Both were blank there.
Changed
titlebar::titlebarno longer moves the window and no longer takes aDragState— put atitlebar::gripin the bar and give it the state instead. The bar used to be oneWindowControlArea::Drag, which is how Windows answersWM_NCHITTEST, and the platform takes the first control area the pointer falls in: every interactive child then had toocclude()to stay clickable, and occluding takes the scroll wheel from everything behind it. Naming the drag surface costs the controls nothing.- The default mono face on Windows is Cascadia Mono, which ships with Windows 11 and with Terminal, in place of Consolas.
ctrl-yredoes off macOS, besidectrl-shift-z, in both the text field and the editor keymaps.bezel-uiturns on a fourthbezel-iconscategory,shapes, for the square a caption button maximizes with. Cargo unions features, so it is the floor for anything depending onui.
Fixed
ctrl-shift-cin a terminal view no longer sendsETX. It was reaching the control-byte table, so copying interrupted the foreground process; it andctrl-shift-vnow fall through for the app to bind, andctrl-cstays SIGINT.