When opened by typing, cosmic-launcher or cosmic-app-library are closed when existing the workspaces overview.
Changed exiting workspaces overview by pressing Escape from KeyReleased to KeyPressed to improve interaction between cosmic-workspaces and cosmic-launcher/cosmic-app-library.
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.
https://github.com/pop-os/cosmic-workspaces-epoch/issues/66. If we want
to hide the workspaces overlay when a popup is opened, that still needs
to be done, but using the same layer as the panel should be good in
general. There's no clear reason to have it on the `Overlay` layer.
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...
This should probably be faster, but it's good for things like this to
not block the UI thread regardless.
We could probably also cache for multiple apps with the same ID. Not
sure if there's a good way to detect changes to the icon for an app id
(Not really needed, probably?)