Introduces a new `core/windows` module (`Nebula.Windows`) with `WindowService`, window/workspace models, and a Sway IPC backend for live window tracking and control (focus, close, move/resize, snap, maximize/restore, minimize, workspace switch). The desktop shell now links this module, uses compositor focus for top-bar active app text, and adds an Open Windows section in the launcher with focus/close actions. Also updates application metadata handling to parse `StartupWMClass` and map window `app_id`/class to friendly names and icons, and revises Sway config/docs for the new floating-first Desktop 0.2 behavior with temporary compositor-provided decorations.
48 lines
1.3 KiB
C++
48 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;
|
|
|
|
signals:
|
|
void connectedChanged();
|
|
void windowsChanged();
|
|
void workspacesChanged();
|
|
void focusChanged();
|
|
};
|