Scenegraph
Here is another part of the upcoming refactor in Wayfire. It is still very WIP, so take any of the current APIs with a grain of salt.
Goals:
-
Remove special cases in rendering and input handling as much as possible. To that purpose, the changes add a new scene graph to Wayfire's API. Eventually, this scenegraph should contain almost everything related to input and output in Wayfire. Examples of special cases intended to be made non-special by this code:
- Drag and drop icons. They are currently hardcoded as special views visible on multiple outputs.
- Custom renderers and input grabs (to be done later in #1320)
- ~~Bindings in general~~
- ~~Focused layers~~ Unsure how this will work out.
- ~~Shortcuts inhibition (once this lands)~~ Seems quite complex for now, we may want to add some special cases still.
All of this is already possible, but is hidden in core behind special-cases and special code paths for handling these things. The scenegraph should contain this state in a way which plugins can understand and manipulate.
-
The scenegraph should also lift the restriction of views being visible on a single output only (although it will remain the default). Views, however, will remain with a single associated 'main output'. Plugins which desire to allow views visible on multiple outputs will need to ensure that workspace operations, etc. work correctly.
-
Decouple the management of input and output elements (scenegraph nodes) from management of other window-manager specific state (geometry, maximized/fullscreen/minimized, workspaces, etc).
These changes will also help with the upcoming transactions API, workspace sets and the refactor of the view and surface interfaces.
Plan for this PR (mostly notes to myself):
- [x] Build the scenegraph from workspace-manager
- [x] Basic views
- [x] Dialogs
- [x] Fullscreen promoted views
- [x] Migrate basic input handling to the scenegraph
- [x] Reimplement basic rendering with the scenegraph
- [x] Remove sublayers, restacking, etc. functionality from the workspace-manager, as this is available via the scenegraph API
- [ ] Move DnD icons to the scenegraph
- [ ] Measure performance and see whether optimizations are necessary
- [ ] Restore restack_below/above functionality for wm-actions
- [ ] Consider exposing wf::seat_t and piping it to nodes for input events