Files
andrew 2f59d3c115 Add Nebula.Windows with Sway IPC backend
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.
2026-08-26 18:20:56 +12:00

48 lines
1.4 KiB
C++

#pragma once
#include "ApplicationFilterModel.hpp"
#include "ApplicationModel.hpp"
#include <QJSEngine>
#include <QObject>
#include <QQmlEngine>
#include <QtQml/qqmlregistration.h>
class ApplicationService : public QObject
{
Q_OBJECT
QML_ELEMENT
QML_SINGLETON
Q_PROPERTY(ApplicationModel *model READ model CONSTANT)
Q_PROPERTY(ApplicationFilterModel *filteredModel READ filteredModel CONSTANT)
Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged)
Q_PROPERTY(int count READ count NOTIFY countChanged)
public:
explicit ApplicationService(QObject *parent = nullptr);
~ApplicationService() override;
static ApplicationService *create(QQmlEngine *engine, QJSEngine *scriptEngine);
static ApplicationService *instance();
ApplicationModel *model() const;
ApplicationFilterModel *filteredModel() const;
QString filter() const;
void setFilter(const QString &filter);
int count() const;
Q_INVOKABLE bool launch(const QString &desktopId) const;
Q_INVOKABLE QString displayNameForWindow(const QString &appId, const QString &windowClass) const;
Q_INVOKABLE QString iconNameForWindow(const QString &appId, const QString &windowClass) const;
Q_INVOKABLE void refresh();
signals:
void filterChanged();
void countChanged();
private:
ApplicationModel *m_model = nullptr;
ApplicationFilterModel *m_filtered = nullptr;
};