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.
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
# Nebula Windows
|
||||
|
||||
Shared C++ window-management service. Desktop, the future Bigscreen shell, and a future Nebula compositor backend should all talk to this library rather than to a compositor directly.
|
||||
|
||||
```text
|
||||
Nebula QML
|
||||
↓
|
||||
WindowService
|
||||
↓
|
||||
generic WindowBackend
|
||||
↓
|
||||
Sway IPC now
|
||||
Nebula compositor later
|
||||
```
|
||||
|
||||
QML must not run `swaymsg`. Sway-specific protocol, socket handling, and tree parsing stay in `backends/sway/`.
|
||||
|
||||
## Behaviour
|
||||
|
||||
- Connects to the compositor IPC socket from `SWAYSOCK`. The path is never hard-coded.
|
||||
- If IPC is missing or fails, the shell keeps running and WindowService stays empty. A development warning is logged.
|
||||
- Subscribes to `window`, `workspace`, and `output` events instead of polling.
|
||||
- Exposes `WindowModel` (`QAbstractListModel`) and `WorkspaceModel`.
|
||||
- Tracks the focused *normal application* window. Layer-shell chrome (desktop, top bar, launcher) is not treated as the active app.
|
||||
- Resolves a user-facing name via `ApplicationService` when possible, then a small identifier humanizer (`footclient` → Foot, `org.mozilla.firefox` → Firefox).
|
||||
|
||||
QML module URI: `Nebula.Windows`.
|
||||
|
||||
## Operations
|
||||
|
||||
`focusWindow`, `closeWindow`, `maximizeWindow`, `restoreWindow`, `setWindowFloating`, plus `moveWindow` / `resizeWindow` / `snapWindow` / `switchWorkspace`.
|
||||
|
||||
`closeWindow` asks the compositor to close the client. It does not kill the process.
|
||||
|
||||
Maximise fills the current workspace usable area (below the Nebula exclusive zone) using compositor-relative sizing. Restore returns the previous floating geometry when WindowService saved it.
|
||||
|
||||
Minimise is implemented for the Sway backend using scratchpad semantics, but the UI must not mention scratchpad. The user-facing idea is only hide / show.
|
||||
|
||||
Snap edges (`SnapLeft`, `SnapRight`, `SnapMaximize`) are prepared for a later Snap Layouts UI.
|
||||
|
||||
See `shells/desktop/README.md` and `compositor/README.md` for session behaviour.
|
||||
Reference in New Issue
Block a user