Introduces a dedicated layer-shell `WindowChromeSurface` that renders macOS-style traffic-light controls over the focused Sway window titlebar, replacing the old top-bar window controls. Adds theme tokens and a reusable `TrafficLightButton` component, updates shell QML/CMake wiring, and adjusts Sway titlebar padding/title format so window titles do not overlap the overlay. Window tracking was extended with focused-window geometry/deco/fullscreen properties plus backend refresh support so the chrome follows window movement and state changes in near real time.
49 lines
1.3 KiB
C++
49 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include "WindowTypes.hpp"
|
|
|
|
#include <QObject>
|
|
#include <QVector>
|
|
|
|
class WindowBackend : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
enum SnapEdge {
|
|
SnapLeft = 0,
|
|
SnapRight,
|
|
SnapMaximize
|
|
};
|
|
|
|
explicit WindowBackend(QObject *parent = nullptr)
|
|
: QObject(parent)
|
|
{
|
|
}
|
|
|
|
~WindowBackend() override = default;
|
|
|
|
virtual bool isConnected() const = 0;
|
|
virtual QVector<WindowInfo> windows() const = 0;
|
|
virtual QVector<WorkspaceInfo> workspaces() const = 0;
|
|
virtual qint64 focusedWindowId() const = 0;
|
|
|
|
virtual bool focusWindow(qint64 windowId) = 0;
|
|
virtual bool closeWindow(qint64 windowId) = 0;
|
|
virtual bool maximizeWindow(qint64 windowId) = 0;
|
|
virtual bool restoreWindow(qint64 windowId) = 0;
|
|
virtual bool minimizeWindow(qint64 windowId) = 0;
|
|
virtual bool setWindowFloating(qint64 windowId, bool floating) = 0;
|
|
virtual bool moveWindow(qint64 windowId, int x, int y) = 0;
|
|
virtual bool resizeWindow(qint64 windowId, int width, int height) = 0;
|
|
virtual bool snapWindow(qint64 windowId, SnapEdge edge) = 0;
|
|
virtual bool switchWorkspace(const QString &workspaceId) = 0;
|
|
virtual bool updateFocusedGeometry() { return false; }
|
|
|
|
signals:
|
|
void connectedChanged();
|
|
void windowsChanged();
|
|
void workspacesChanged();
|
|
void focusChanged();
|
|
};
|