Commit graph

117 commits

Author SHA1 Message Date
Victoria Brekenfeld
59fd732982 shell/elements: Handle clipping and shadows 2026-01-13 19:12:22 +01:00
Victoria Brekenfeld
2adebb5fe1 config: Add and propagate appearance_config 2026-01-13 19:12:22 +01:00
Victoria Brekenfeld
77d3605fb9 Update smithay for DnD updates 2025-12-04 20:17:12 +01:00
Victoria Brekenfeld
e5ea486ea0 shell/stack: Don't reset previous_keyboard on noop set_active call 2025-11-11 20:18:58 -07:00
Ian Douglas Scott
505e36dcda Make CosmicWindowInternal/CosmicStackInternal not Clone
`IcedElement` uses `Arc` internally (and compares with `Arc::ptr_eq`).
So these structs are never cloned, and probably shouldn't be.
2025-11-04 15:41:08 -08:00
Yureka
a74b6e3a9b Add hooks for custom window decorations
This is a first use of the new hooks system, which allows customizing
cosmic-comp at compile-time.
In this case, the view() function of CosmicWindow / CosmicStack is
hooked and the hook can change what is rendered as the header bar.

Signed-off-by: Yureka <yuka@yuka.dev>
2025-10-29 11:27:14 +01:00
Vukašin Vojinović
1f7f0c70b7 chore: format for Rust 2024 2025-10-22 23:55:11 +02:00
Vukašin Vojinović
5e9ea93819 chore: manual clippy 2025-10-22 23:55:11 +02:00
Vukašin Vojinović
0847247c33 chore: clippy 2025-10-22 23:55:11 +02:00
Ashley Wulber
3465ce7602 feat: corner radius for CosmicMapped 2025-10-03 20:11:16 +02:00
Vukašin Vojinović
7f7ab8bcbe chore: Rust 2024 edition
Set the formatting style to 2021 edition to avoid disrupting existing work.
Remove when possible.
2025-08-21 13:10:11 +02:00
Vukašin Vojinović
fec7c94605 chore: use std::sync::LazyLock 2025-08-21 13:10:11 +02:00
Victoria Brekenfeld
c3d2b5f0b7 element: Allow overriding default scanout behaviour 2025-08-07 19:40:23 +02:00
Michael Aaron Murphy
86493b7898 improv(stack): use system theme colors 2025-07-31 17:19:49 +02:00
Ashley Wulber
f2d6f70e13 fix: only activate the active window of the stack on activation 2025-07-22 13:31:24 +02:00
Victoria Brekenfeld
adedb705e7 shell: handle fullscreen windows on a dedicated layer
I hoped to split this up into multiple commits, but the api
changes to `shell/workspace.rs` were to invasive to feasibly do this.

Here is a rough list of changes:

- Fullscreen windows aren't mapped to other layers anymore
  - This they need their own logic for:
    - Sending frames
    - Dmabuf Feedback
    - Primary outputs
    - On commit handlers
    - cursor tests
  - They get their own unmap/remap logic
  - They get a new restore state similar to minimized windows
    - Refactored the minimized window state to reuse as much as possible
      here
  - They need to be part of focus stacks, which means adjusting them
    to a new type `FocusTarget` as they previously only handled
    `CosmicMapped`.
  - Various shell handlers (minimize, move, menu) now have dedicated
    logic for fullscreen surfaces
    - This was partially necessary due to relying on CosmicSurface now,
      partially because they should've had their own logic from the
      start. E.g. the context menu is now reflecting the fullscreen
      state
- Fullscreen windows may be rendered behind other windows now, when they
  loose focus.
  - This needed changes to input handling / rendering
2025-07-04 19:45:54 +02:00
Ian Douglas Scott
fa4bffdbe6 Add cursor_image_status/set_cursor_image_status to SeatExt
The `cursor_image_status()` function saves some duplication in various
places. The `set_cursor_image_status()` saves a bit less, but is also
handy.
2025-06-10 19:24:05 +02:00
Victoria Brekenfeld
465813c1c5 shell: Using parking_lot's RwLock for fairness guarantees 2025-05-27 20:00:21 +02:00
Victoria Brekenfeld
0be83fe930 iced: Optimize updates 2025-04-28 18:03:09 +02: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
Victoria Brekenfeld
95b27637ae chore: smithay update 2025-03-12 16:50:58 +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
Victoria Brekenfeld
e0f78da0ae stack: Fix input at bottom of window 2025-02-21 15:01:02 +01:00
Victoria Brekenfeld
df9441804d iced: Track last seat/serial for grabs 2025-02-20 23:51:55 +01:00
Daniel
2553810621
grabs: Snap Window Edges to Close Output Edges 2025-02-14 11:58:09 +01:00
Ian Douglas Scott
b685512127 Migrate away from Rectangle::from_loc_and_size
Deprecated in `smithay` by https://github.com/Smithay/smithay/pull/1621.
2025-01-07 12:50:35 +01:00
Yureka
9b78a2d780 refactor(shell/element): refactor how decorations height is accessed
This fixes several things:
- The xwayland code previously incorrectly used the SSD_HEIGHT (for Windows) even when the X11 surface was in a stack
- The SSD_HEIGHT was defined in surface.rs, even though rendering serverside decorations is done in the window/stack

Rename (min|max)_size to (min|max)_size_without_ssd in CosmicSurface and make it act accordingly
Add a new (min|max)_size() in CosmicWindow and CosmicStack, which takes the surface's (min|max)_size and adds the decorations.
Change all callers to use (min|max)_size() from the window or stack respectively, except is_dialog() where it does not matter.
2024-12-28 15:32:03 +01:00
Vukašin Vojinović
7de52054ff chore: update iced/libcosmic 2024-12-11 16:58:16 +01:00
Victoria Brekenfeld
fc84fa9948 shell: Fix windows global geometry to include ssd 2024-12-05 18:20:10 +01:00
Victoria Brekenfeld
0092dac08c input: Use render_input_order 2024-10-22 19:43:47 +02:00
Victoria Brekenfeld
51c8588f89 render: Use render_input_order 2024-10-22 19:43:47 +02:00
may
0ffe6ae718
wayland: Implement cursor-shape-v1 2024-09-09 16:21:27 +02:00
João Capucho
3c24934f48 Track if a move or resize request is client initiated 2024-08-23 17:18:39 +02:00
Victoria Brekenfeld
dc3dbfdba0 chore: Remove unused method 2024-08-02 20:54:15 +02:00
Victoria Brekenfeld
c3524d3546 stack: Fix round corners on maximize 2024-08-02 20:54:15 +02:00
Victoria Brekenfeld
61f11d1363 element/stack: Style fixes 2024-07-26 14:59:11 +02:00
Ian Douglas Scott
94fecec9cb Add a SplitRenderElements type, with useful methods
`(w_elements, p_elements)` tuples are used in a bunch of places. A
struct with named fields is generally an improvement just due to the
fact the order is non-obvious.

But we can also add methods. In particular,
`extend_from_workspace_elements` abstracts out some of the more
redundant code in `workspace_elements`.

It would be nice to avoid allocation everywhere, but iterators would
complicate lifetimes, run into issues with needing multiple mutable
borrows to things like the `Renderer`, and be awkward in certain
functions without generator syntax. In any case, cosmic-comp already
relies on allocating vectors here.

If this abstraction is commonly useful in compositors, perhaps it could
be moved to Smithay.
2024-07-15 17:12:05 +02:00
Michael Aaron Murphy
553c49b42b feat: runtime configurable keybindings 2024-07-01 15:20:23 +02:00
Victoria Brekenfeld
92f3dbce01 chore: Cleanup 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
c7d50e7c5b seat: Make render-related state thread-safe 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
bd58481d19 element: Introduce CosmicMappedKey for safely hashing windows across threads 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
e78e199663 chore: Update smithay for thread-safety 2024-06-26 12:59:33 +02:00
Ian Douglas Scott
f2342f56c1 Update to latest Smithay version 2024-06-19 12:39:16 +02:00
Ian Douglas Scott
4f076e0753 Update smithay, with xwayland shell, Cow, etc. 2024-05-21 19:31:50 +02:00
Ian Douglas Scott
73b12194c0 Update smithay 2024-05-10 13:51:28 +02:00
Ian Douglas Scott
8cee91c88f Support touch drag for SSD toplevels, and stacks
We already direct touch events to Iced, and the Cosmic `HeaderBar`
widget already recognizes drags from touch events. So it seems updating
`last_seat` is all that was needed for windows SSDs.

For stacks, the same works, plus moving using the same logic for
detecting drags that is used for mouse events.
2024-04-19 09:30:46 +02:00
Victoria Brekenfeld
5d5a510691 state: Move shell behind RwLock 2024-04-16 18:50:54 +02:00
Ian Douglas Scott
c957d673ba CosmicStack: Share Focus type with CosmicWindow
There's probably more duplicated logic that can be abstracted, but this
removes a bit of redundancy at least.
2024-04-02 17:12:28 +02:00
Ian Douglas Scott
26d2556be0 Initial touch support for SSD 2024-04-02 17:12:28 +02:00