Works alongside panel changes in
https://github.com/pop-os/cosmic-panel/pull/485.
We can't set an exclusive zone in the panel, since that would cause all
the workspaces to re-layout to make space for it, and also impact
workspace capture. Instead, cosmic-workspaces reads the config and adds
appropriate margins.
Workspaces can be pinned, and dragged to reorder or move to a different
output.
These features are enabled only if cosmic-workspace-v2 advertises the
necessary protocol version and capabilities.
The layout of the labels and pin buttons could be tweaked a bit still.
Some hacks and workarounds are needed to get drag and drop working as
desired. Something iced and libcosmic could potentially improve in the
future. But this now seems fairly robust.
Potentially relevant on compositors not advertising this, or if a
compositor wanted to advertise `Activate` support for some but not all
workspaces. This will be more relevant with other capabilities.
This makes the `workspace_bar` more responsive to different child sizes, which enables fixing the size of the smaller dimension of the screencopy, while allowing it to expand unrestricted in the larger dimension (to match the aspect ratio).
Works, I'm not sure how many pixels to interpret as a change to the
workspace, and perhaps it should accumulate multiple deltas with a
timer. Assuming some lower level of the stack isn't doing that already.
I only see `ScrollDelta::Pixels` events, not `Lines`, though maybe
that's relevant with a different type of input device.
The behavior would also be clearer with animation, though it doesn't
seem to bad
(https://github.com/pop-os/cosmic-workspaces-epoch/issues/32).
Fixes https://github.com/pop-os/cosmic-workspaces-epoch/issues/34.
I guess some change is needed for handling workspaces that span outputs
(can't encode both the workspace and output id in less than 64 bits, and
need bits for discriminant as well). But that's an issue with the
previous workspace index based approach.
I wonder if `drag_id` is really needed; libcosmic could check if the
drag is in bounds of the widget, if drag surfaces can't overlap...