You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been tinkering with wlr-foreign-toplevel-management, and I'm finally at a stage where I have something to show.
My general idea was to implement a server side widget that would work a bit like a mouse-area. It's goal is not to present anything, but to allow for the state to be notified of changed in the task.
tasklist_2.mp4
The widget currently exposes 3 signals sources:
Enter: A new task is being tracked by the widget.
Leave: A task stopped being tracked by the widget.
Update: A tracked task state has changed.
The widget additionally take a single child which will hold the content to be rendered (this means the config choose how the actual task is being rendered.
How it works:
Snowcap is notified of the state change for wlr-foreign-toplevel-management.
A set of custom operation are broadcasted to every surfaces.
The widget react to this operation and prepare message that are stored in its internal state.
The pending changes are converted into messages next time the update function is called
After the broadcast is done, wlr-foreign-toplevel-management functions request a redraw.
Planned features (assuming I/we proceed with this):
Make the widget output aware, so it only notify for toplevels on its output (and make this a config option)
Add a way to interact with the tasks being displayed. The idea here would be to implement additional operation exposed to the config to call some methods on wlr-foreign-toplevel-management handles. The preliminary work is already done, as the widget hold on weak handles, and transmit a unique id as part of the messages it emit.
Notes & caveat:
I've base the POC on wlr-foreign-toplevel-management because it's supported by most compositor and can actually control the foreign toplevels.
However this protocol has a few limitation:
No support for workspace, the best you can do is filter per output.
No unique identifier per toplevel (so no way to tie it back to pinnacle config).
ext-foreign-toplevel-list doesn't have a way to act on the toplevel yet, but we get an identifier that we can the tie back to the config using WindowHandle:foreign_toplevel_list_identifier()
Long term, I think we should move to foreign-toplevel-state (assuming it gets merged), but for the time being, there are a few things that can be done:
Have a WlrTaskList widget (essentially what I have a poc for), that only cares about the wlroot implementation, even if it have some limitation.
Have a TaskList/ExtTaskList widget, and let the config fill the gap using the identifier (we may want to add some way to get a WindowHandle from a identifier).
Implement foreign-toplevel-state ahead of time as an experimental support to augment the TaskList/ExtTaskList widget. This could also help with the protocol getting merged, since it needs to have some implementations in use (not actually required, with cosmic, niri & wlroots actively participating in the PR)
Implement a protocol, either to add a state of our own while waiting for foreign-toplevel-state, or to tie foreign-toplevel-list and wlr-foreign-toplevel-management, so we can use the data coming from pinnacle while writing our config.
(these options are not mutually exclusive. I don´t really plan on scrapping WlrTaskList, and part of the implementation can be re-used regardless of what's end up being done.)
I have a bit of cleanup to do, then I'll open a PR with my current work
I've been tinkering with wlr-foreign-toplevel-management, and I'm finally at a stage where I have something to show.
My general idea was to implement a server side widget that would work a bit like a mouse-area. It's goal is not to present anything, but to allow for the state to be notified of changed in the task.
tasklist_2.mp4
The widget currently exposes 3 signals sources:
Enter: A new task is being tracked by the widget.
Leave: A task stopped being tracked by the widget.
Update: A tracked task state has changed.
The widget additionally take a single child which will hold the content to be rendered (this means the config choose how the actual task is being rendered.
How it works:
wlr-foreign-toplevel-management.Planned features (assuming I/we proceed with this):
Notes & caveat:
I've base the POC on wlr-foreign-toplevel-management because it's supported by most compositor and can actually control the foreign toplevels.
However this protocol has a few limitation:
ext-foreign-toplevel-listdoesn't have a way to act on the toplevel yet, but we get an identifier that we can the tie back to the config usingWindowHandle:foreign_toplevel_list_identifier()Long term, I think we should move to
foreign-toplevel-state(assuming it gets merged), but for the time being, there are a few things that can be done:WlrTaskListwidget (essentially what I have a poc for), that only cares about the wlroot implementation, even if it have some limitation.foreign-toplevel-stateahead of time as an experimental support to augment the TaskList/ExtTaskList widget. This could also help with the protocol getting merged, since it needs to have some implementations in use (not actually required, with cosmic, niri & wlroots actively participating in the PR)foreign-toplevel-state, or to tie foreign-toplevel-list and wlr-foreign-toplevel-management, so we can use the data coming from pinnacle while writing our config.(these options are not mutually exclusive. I don´t really plan on scrapping WlrTaskList, and part of the implementation can be re-used regardless of what's end up being done.)
I have a bit of cleanup to do, then I'll open a PR with my current work