Commit graph

1496 commits

Author SHA1 Message Date
Victoria Brekenfeld
ea09334ff7 config: Add screen-filter configuration and persistent state 2025-03-24 19:10:52 +01:00
Victoria Brekenfeld
c10d400d70 screencopy: Remove unnecessary lifetime 2025-03-24 19:10:52 +01:00
Ian Douglas Scott
b52d84dbd3 Call underlying_storage of TextureRenderElement without mapping
This was mapping `UnderlyingStorage::Memory` to `None`. I don't see any
reason for this. Though this also shouldn't change behavior since
`TextureRenderElement` doesn't provide `underlying_storage` currently.
2025-03-24 19:10:52 +01:00
Clayton Craft
29a649541d kms.timings.presented: print debug msg when frame time is overflowing
Also see: #1062
2025-03-19 18:45:44 +01:00
Clayton Craft
8f40fc7a1b kms: protect against potential overflow of Duration when calculating avg frametime
Also see: https://github.com/Smithay/smithay/pull/1685

Fixes #1062

Co-authored-by: Victoria Brekenfeld <victoria@system76.com>
2025-03-19 18:45:44 +01:00
Ian Douglas Scott
dbd43d7582 shell: Refactor out common code for removing workspace from set 2025-03-17 12:00:17 -07:00
Ian Douglas Scott
bdd3e12ace Fixes for migrate_workspace
Previously, this was not updating the workspace indices on either the
old or new set, and left no workspace on the old set with `Active`
state. It also didn't add a workspace if the last workspace was removed.
2025-03-17 12:00:17 -07:00
Ian Douglas Scott
dd6df7b92a Refactor out duplicated workspace_set_idx loops
This isn't too bad, but it seems best to avoid the same enumerate loop
in multiple places.
2025-03-17 12:00:17 -07:00
Ian Douglas Scott
cee8ffd463 Send one-dimensional workspace coordinates, without output index
`ext_workspace_handle_v1::coordinates` defines the coordinate as
"an N-dimensional grid within a workspace group". So it is not
expected that the coordinates are unique between different groups, or
establish any geometry between different groups.

Whether we use one workspace per output or allow workspaces to span
outputs in the protocol, the whole workspace group is on the same set of
outputs. So I think this holds in any case.

I don't think we rely on this anywhere.
2025-03-17 12:00:17 -07:00
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
Ian Douglas Scott
96cbaad7b7 Update smithay 2025-03-14 17:53:34 +01:00
Ian Douglas Scott
1387535252 Fix dependency_on_unit_never_type_fallback warning on latest Rustc
Apparently in Rust 2024, the inferred type here would be `!`, which
doesn't implement `Default`. Explicitly use `()` instead.

https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html
2025-03-14 17:50:17 +01:00
Victoria Brekenfeld
c3f130e5bf chore: Update rust toolchain 2025-03-12 18:31:39 +01:00
Victoria Brekenfeld
0ed2841435 iced: Don't call update from render_elements 2025-03-12 16:59:05 +01:00
Victoria Brekenfeld
0f5ba624c5 iced: Don't throttle resizes 2025-03-12 16:59:05 +01:00
Victoria Brekenfeld
ea1800f157 input: Fix events for subsurfaces of lock surface 2025-03-12 16:55:22 +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
f9dd922af3 protocol/workspace: Store ext/cosmic specific capabilities
This means a change to an ext capability will not send a redundant
cosmic capability event, and vice versa.

This will be more important when cosmic-specific states are added. Since
those may change often.
2025-03-12 15:44:35 +01:00
Ian Douglas Scott
dea7f2f825 protocol/workspace: Split ext/cosmic-v1 workspace data into two types 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
24bf2e856a iced: refresh after output_enter 2025-03-07 14:37:17 +01:00
Victoria Brekenfeld
a1211e2499 floating: Refresh space after mapping 2025-03-07 14:37:17 +01:00
Victoria Brekenfeld
01bc39dade main: throttle refresh 2025-03-06 21:28:52 +01:00
David Carvalho
943f97137c i18n (pt-BR) update translation 2025-03-05 18:27:32 +01:00
João Ribeiro
6ba76eb9a4 i18n(pt): update Portuguese translation 2025-03-05 18:27:01 +01:00
Luna Jernberg
15958c1374 Create cosmic_comp.ftl (Swedish)
Add Swedish translation
2025-03-05 18:26:23 +01:00
Feike Donia
f6db5d46f8 i18n(nl) update Dutch translation
Makes Dutch translation for the zoomed view consistent with Cosmic-Settings
2025-03-05 18:25:40 +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
e6f563d04e ci: Update unsupported cache v2 action to v4 2025-03-03 13:31:46 -08:00
Ian Douglas Scott
8b63e09ddc fix(protocol/workspace): Handle cosmic-workspace-v2 destroy requests
I forgot to handle these after I added them to destructors to the
protocol.

I wish we had exhaustiveness checking here...
2025-03-03 13:21:36 -08: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
0b23a01736 Update cosmic-protocols 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
Ian Douglas Scott
0a6f2726cb protocol/toplevel_management: Use WorkspaceHandle in argument
Already depends on `WorkspaceHandler`, so it can get the handle, and
toplevel info uses `WorkspaceHandle`s.
2025-03-03 12:30:25 +01:00
Ian Douglas Scott
1f2434e590 protocol/workspace: Fix initial sending of states and capabilities
The protocol states that these should always be sent, but this was
not initially sending bitflags if they were empty. That works, but isn't
what the protocol states.

Not wrapping the bitflag fields in options works well for `Workspace`,
but not for `WorkspaceDataInner`.
2025-03-03 12:30:25 +01:00
Michael Aaron Murphy
b93db878e2 feat: add shortcut for input source switch 2025-02-26 15:13:35 +01:00
mkljczk
a27c1002e4 i18n(pl): update translation 2025-02-24 12:21:17 +01:00
therealmate
8b0177845d Update Hungarian translations 2025-02-24 12:21:08 +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