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:
@@ -37,6 +37,8 @@ class WindowService : public QObject
|
||||
Q_PROPERTY(int focusedWindowDecoY READ focusedWindowDecoY NOTIFY focusedWindowGeometryChanged)
|
||||
Q_PROPERTY(int focusedWindowDecoWidth READ focusedWindowDecoWidth NOTIFY focusedWindowGeometryChanged)
|
||||
Q_PROPERTY(int focusedWindowDecoHeight READ focusedWindowDecoHeight NOTIFY focusedWindowGeometryChanged)
|
||||
Q_PROPERTY(int focusedWindowTitleBarY READ focusedWindowTitleBarY NOTIFY focusedWindowGeometryChanged)
|
||||
Q_PROPERTY(int focusedWindowTitleBarHeight READ focusedWindowTitleBarHeight NOTIFY focusedWindowGeometryChanged)
|
||||
|
||||
public:
|
||||
enum SnapEdge {
|
||||
@@ -69,6 +71,8 @@ public:
|
||||
int focusedWindowDecoY() const;
|
||||
int focusedWindowDecoWidth() const;
|
||||
int focusedWindowDecoHeight() const;
|
||||
int focusedWindowTitleBarY() const;
|
||||
int focusedWindowTitleBarHeight() const;
|
||||
|
||||
Q_INVOKABLE bool focusWindow(const QString &windowId);
|
||||
Q_INVOKABLE bool closeWindow(const QString &windowId);
|
||||
@@ -118,5 +122,7 @@ private:
|
||||
int m_focusedWindowDecoY = 0;
|
||||
int m_focusedWindowDecoWidth = 0;
|
||||
int m_focusedWindowDecoHeight = 0;
|
||||
int m_focusedWindowTitleBarY = 0;
|
||||
int m_focusedWindowTitleBarHeight = 0;
|
||||
QTimer *m_geometryTimer = nullptr;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user