Commit graph

827 commits

Author SHA1 Message Date
Ian Douglas Scott
8d6bd47bc4 Take slice instead of array in set_workspace_coordinates
As far as I can tell this is equivalent, and there's no particular
reason to use an array. Arrays of options for variable-length arrays are
awkward.
2025-03-17 12:00:17 -07:00
Ian Douglas Scott
7340e2beff Improve handling of XDG activation tokens in shell
Requires https://github.com/Smithay/smithay/pull/1676.

This changes two things:
* `Workspace::is_empty` no longer checks if there are activation tokens,
  but a separate `Workspace::can_auto_remove` checks if the workspace is
  empty and has no activation tokens.
  - When we add workspace pinning, that can also be checked there.
* `Workspace` no longer contains a `pending_tokens` list that is updated
  on `refresh`. Instead, `can_auto_remove` takes the xdg activation
  state as an argument.

Since `Workspace::refresh` normally is run for focused workspaces, this
fixes allowing non-focused workspaces to be removed when an activation
token expires. It seems generally good to avoid tracking the activation
tokens in two places, and this is probably more efficient than needing
to refresh in more places.

By splitting this, we still don't remove an empty workspace if it has a
pending activation token, but we also don't add an empty workspace for
an activation token.

This mitigates the confusing behavior with activation tokens that aren't
used, but having to wait a few seconds in some cases before a workspace
is removed is still a little confusing. (We probably want `cosmic-term`
and `cosmic-workspace` to either consume the activation tokens they are
passed, or not be passed tokens when started by keybinding?)

Fixes https://github.com/pop-os/cosmic-comp/issues/1099.
2025-03-14 17:53:34 +01:00
Peter Krull
ad2cba324e fix: Remove extra scaling of borders 2025-03-12 16:55:00 +01:00
Victoria Brekenfeld
95b27637ae chore: smithay update 2025-03-12 16:50:58 +01:00
Ian Douglas Scott
f8fae8a5b0 shell: On output_remove, focus moved workspace instead of empty one
On `output_remove`, if the output a workspace is moved to had no
non-empty workspaces (or did, but had an empty one active), the empty
workspace would remain active, and the workspace that was active on the
removed output is no longer visible.

Instead, change the active workspace to the one that was active on the
removed output.

This addresses another edge case where hotplug results in an empty
workspace, followed by other non-empty workspaces, and generally seems
like a better experience.

This could be further restricted by only applying if `new_set` is not on
the active output (to not mess with what the user is interacting with,
even it's an empty workspace) or only if the old `set` was the active
output, etc. But it seems good without further restriction.
2025-03-12 15:44:35 +01:00
Ian Douglas Scott
c72002e15a shell: If active workspace moved, add WState::Active to new active 2025-03-12 15:44:35 +01:00
Ian Douglas Scott
2b7f898e83 shell: Fix getting active_handle for other_set
Use `other_set.active`, not `set_active`.
2025-03-12 15:44:35 +01:00
Victoria Brekenfeld
8a32571b8a tiling: Exclude maximized windows from input/render 2025-03-07 18:52:03 +01:00
Victoria Brekenfeld
a1211e2499 floating: Refresh space after mapping 2025-03-07 14:37:17 +01:00
Dusan
a96497f6f7 shell: next_output - axis overlap filter logic without negation
Signed-off-by: Dusan <dusanuveric@protonmail.com>
2025-03-05 18:24:28 +01:00
Victoria Brekenfeld
1a019280f3 actions: Remember previous workspace on extended action 2025-03-05 18:24:28 +01:00
Victoria Brekenfeld
d76f372c29 actions: Shortcut handling changes for #1005 2025-03-05 18:24:28 +01:00
Victoria Brekenfeld
638684642c stack: Remember position during continuous move action 2025-03-05 18:24:28 +01:00
Victoria Brekenfeld
e116f20396 stack: Remember previous position during focus navigation 2025-03-05 18:24:28 +01:00
Ian Douglas Scott
aac8166962 Add cosmic-workspace-v2, image source, toplevel info changes
This new protocol extends `ext-workspace-v1` with the same additional
functionality `cosmic-workspace-v1` provided. Toplevel info and toplevel
management are also updated to use ext handles, and there's an image
source for ext workspaces.

For now, the old protocol is still supported.
2025-03-03 12:30:25 +01:00
Ian Douglas Scott
47d142166b Set WorkspaceCapabilities::SetTilingState capability
`cosmic-comp` handles `SetTilingState` requests, so it looks like it was
incorrectly not advertising this.
2025-03-03 12:30:25 +01:00
Victoria Brekenfeld
e0f78da0ae stack: Fix input at bottom of window 2025-02-21 15:01:02 +01:00
Victoria Brekenfeld
61bde9f3b9 grabs/resize: Fix Xwayland geometry 2025-02-21 14:23:41 +01:00
Victoria Brekenfeld
9042f0adf4 zoom: bugfixes 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
c45a58c16c wayland: Implement cosmic-a11y-v1 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
fff9b357f6 zoom: Add separator to popup 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
9e8c2f5e24 zoom: Be a little more lenient with OnEdge movement and fractional cursor positions 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
909ca8cf9d zoom: Seperate animating/current focal_point 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
726a53b6b9 zoom: Reload config after writing 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
d30671c984 zoom: Localize zoom ui 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
3cff46d7e5 shell: Rescale zoom UI with zoom factor 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
07a471f285 zoom: Don't render at 100% scale while animating 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
f72d2b91f3 shell: Add zoom UI 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
55e4dd7c0f config: Handle zoom updates in Common::update_config 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
df9441804d iced: Track last seat/serial for grabs 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
6fd1a48e60 grab: Refactor MenuGrab to be useful for zoom ui 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
b7d4a66c22 input: Zoom on Super+Scroll 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
7267c44116 shell: Cleanup zoom state 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
4f67e89373 shell: Reset focal point if cursor outside OnEdge area 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
15c5e3fe26 shell: don't accidentally reset zoom when using multiple seats (theoretically) 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
531a1c951f zoom: Handle multiple outputs 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
c01de20b2b shell: Allow triggering zoom 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
2e2943d99c render: Scale contents according to zoom_level 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
a57a2163f6 floating: Fix resize indicator order 2025-02-20 20:11:40 +01:00
Daniel
2bf74951ea Update moving.rs 2025-02-14 15:32:01 +01:00
Daniel
2553810621
grabs: Snap Window Edges to Close Output Edges 2025-02-14 11:58:09 +01:00
Ian Douglas Scott
723f758439 protocol/workspace: Add support for ext-workspace-v1
To support both `ext-workspace-v1` and `cosmic-workspace-unstable-v1`,
the API exposed by `wayland/protocols/workspace` now uses the ext
workspace `State` and `GroupCapabilties` bitfields, and converts them to
the cosmic types for the cosmic implementation.

`WorkspaceCapabilities` is a custom type that has cosmic-specific and
ext-specific variants, and is mapped on both backends.

The ext protocol adds an `.assign` request on workspaces, which is
added here, though not currently used.

It also adds an `.id` event. Which we'll probably want when we have
persistent workspaces, but it isn't needed currently.

We still need to add an extension protocol of ext-workspaces to replace
a couple cosmic protocol features.
2025-02-13 11:31:38 +01:00
Paul Daniel Faria
f1f9d205be
Make numlock state on boot configurable
Make numlock state on boot configurable

This will expose 3 settings for numlock behavior:
1. Numlock is off on boot (this is the current default behavior)
2. Numlock is on on boot
3. Numlock will restore the state from the last boot

Fixes #369

* Address comments:

Get keyboard after create_seat called rather than returning from
create_seat.
Use constants rather than magic numbers for keypress.
Only save updated modifier state after keypresses are handled/skipped.

* Remove unused import, fold other into existing use block.
2025-02-12 14:35:22 +01:00
Victoria Brekenfeld
f6143747da layout/floating: Fix indicator element order 2025-02-07 13:32:30 +01:00
Victoria Brekenfeld
0deab8d9ed layout/tiling: Fix swap stack overlay offset 2025-02-07 13:32:30 +01:00
Victoria Brekenfeld
c59e9a3c52 layout/tiling: Fix swap indicator element order 2025-02-07 13:32:30 +01:00
Victoria Brekenfeld
b793975689 shell: Don't animate programmatic maximize_requests 2025-02-07 13:02:42 +01:00
Victoria Brekenfeld
156f634944 shell: Handle maximize requests before commit 2025-02-07 13:02:42 +01:00
Ian Douglas Scott
3b0aa9e427 shell: Remove last workspace if it follows empty active workspace
Partly fixes
https://github.com/pop-os/cosmic-workspaces-epoch/issues/83, but it
seems like there's at least one other issue with workspaces not being
removed when they should be.

The if condition got a bit complicated here, so I've split it up and
inverted the condition.
2025-02-04 14:55:29 +01:00
Ian Douglas Scott
63995c4919 Remove CosmicMapped::stack_ref_mut
The methods of `CosmicStack` take `&self`, so this isn't actually needed
for anything.
2025-01-28 10:13:52 -08:00