Align window chrome with Sway title bars

Adds focused title-bar geometry to the window service and updates the Sway backend to derive frame data more reliably (including parent node fallback and content rect tracking for wrapped/floating views). Window chrome positioning now centers against the actual title bar instead of deco offsets, improving alignment. Also refreshes visual sizing/padding for traffic-light controls and Sway titlebar spacing to match the new chrome metrics.
This commit is contained in:
2026-08-26 22:45:50 +12:00
parent 4321209e92
commit 4d70014242
9 changed files with 100 additions and 33 deletions
@@ -10,15 +10,12 @@ Window {
readonly property bool active: WindowService.hasFocusedWindow
&& !WindowService.focusedWindowFullscreen
&& !ShellState.launcherOpen
readonly property int chromeX: WindowService.focusedWindowX
+ WindowService.focusedWindowDecoX
+ Theme.windowChromeInset
readonly property int chromeX: WindowService.focusedWindowX + Theme.windowChromeInset
readonly property int chromeY: {
const top = WindowService.focusedWindowY + WindowService.focusedWindowDecoY
const decoHeight = WindowService.focusedWindowDecoHeight
if (decoHeight <= 0)
return top + 6
return top + Math.max(0, Math.round((decoHeight - height) / 2))
const barY = WindowService.focusedWindowTitleBarY
const barH = Math.max(WindowService.focusedWindowTitleBarHeight, height)
const centered = barY + Math.round((barH - height) / 2)
return centered - Theme.topBarHeight
}
title: qsTr("Nebula Window Chrome")