Fix Sway floating frame geometry handling

Use the floating container geometry whenever a view is inside a `floating_con`, so frame/deco/content coordinates stay stable and window chrome no longer jumps during refreshes. Also remove the custom `title_format` left-padding (and its related comment) from the Sway config so title text is no longer artificially offset.
This commit is contained in:
2026-08-26 23:00:11 +12:00
parent 75a74a4f01
commit e4ea19cd09
2 changed files with 11 additions and 3 deletions
@@ -75,7 +75,17 @@ void applyFrameGeometry(WindowInfo &window, const QJsonObject &node, const QJson
int decoHeight = deco.value(QStringLiteral("height")).toInt();
int contentY = content.value(QStringLiteral("y")).toInt();
if (decoHeight <= 0 && contentY <= 0 && !parent.isEmpty()) {
// Floating views live inside a floating_con whose rect includes Sway's
// server-side title bar. The child view rect is the client content rect.
// Always use the wrapper while it exists so refreshes cannot make chrome
// jump between frame and content coordinates.
if (nodeIsFloating(parent)) {
rect = parent.value(QStringLiteral("rect")).toObject();
deco = parent.value(QStringLiteral("deco_rect")).toObject();
content = parent.value(QStringLiteral("window_rect")).toObject();
decoHeight = deco.value(QStringLiteral("height")).toInt();
contentY = content.value(QStringLiteral("y")).toInt();
} else if (decoHeight <= 0 && contentY <= 0 && !parent.isEmpty()) {
const QJsonObject parentDeco = parent.value(QStringLiteral("deco_rect")).toObject();
const QJsonObject parentContent = parent.value(QStringLiteral("window_rect")).toObject();
const int parentDecoHeight = parentDeco.value(QStringLiteral("height")).toInt();