Commit graph

111 commits

Author SHA1 Message Date
Victoria Brekenfeld
5216eb50ba chore: Fix remaining clippy lints 2026-03-24 16:23:43 +01:00
Ian Douglas Scott
c0c7a26178 Move some trait bounds to definition of AsGlowRenderer
Everything implementing `AsGlowRenderer` implements `Renderer` and various
other traits, and by making `AsGlowRenderer` depend on these trait,
things requiring `AsGlowRenderer` can avoid listing those traits as
well.

Looks like implied trait bounds still won't work for the
`Self::TexutureId` and `Self::Error` requirements? So those are not
included here.
2026-03-18 01:34:33 +01:00
Ian Douglas Scott
0d6c83db31 Revert "Move some trait bounds to definition of AsGlowRenderer"
This reverts commit c860fcddad.

Accidentally pushed to wrong branch.

If only branch protection has a way to prompt for overriding rule on
push...
2026-03-11 20:08:33 -07:00
Ian Douglas Scott
c860fcddad Move some trait bounds to definition of AsGlowRenderer
Everything implementing `AsGlowRenderer` implements `Renderer` and various
other traits, and by making `AsGlowRenderer` depend on these trait,
things requiring `AsGlowRenderer` can avoid listing those traits as
well.

Looks like implied trait bounds still won't work for the
`Self::TexutureId` and `Self::Error` requirements? So those are not
included here.
2026-03-11 10:14:40 -07:00
Victoria Brekenfeld
e4e7567174 element: Clip to tile size if available instead of element geometry 2026-01-13 19:12:22 +01:00
Victoria Brekenfeld
15bbada498 shell/element: Don't render decorations for dead windows 2026-01-13 19:12:22 +01:00
Victoria Brekenfeld
6d0f1b273f layout/tiling: Resize shadows to fit scaled windows 2026-01-13 19:12:22 +01:00
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
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
Ian Douglas Scott
b75be5b305 Remove last_cursor_position from CosmicMapped
Since 5459f52d, this is no longer ever set.
2025-09-18 23:36:30 +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
Ian Douglas Scott
2fbf0081ea Fix compile warnings on nightly
Should fix CI test.
2025-08-12 18:03:27 -04:00
Victoria Brekenfeld
c3d2b5f0b7 element: Allow overriding default scanout behaviour 2025-08-07 19:40:23 +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
614d99fc05 Update smithay, egui, and smithay-egui 2025-06-25 20:32:53 +02: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
Victoria Brekenfeld
95b27637ae chore: smithay update 2025-03-12 16:50:58 +01:00
Victoria Brekenfeld
e116f20396 stack: Remember previous position during focus navigation 2025-03-05 18:24:28 +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
Victoria Brekenfeld
df74a322ab mapped: Allow to query in-flight configure for resize throttling 2025-01-16 19:44:12 +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
Victoria Brekenfeld
3926aee5b6 debug: Fixup feature compilation 2025-01-06 20:23:05 +01:00
Victoria Brekenfeld
61b0dddf50 chore: Fix a few warnings 2025-01-06 20:23:05 +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
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
Ian Douglas Scott
a96394f7a6 Update egui, smithay-egui, smithay 2024-10-02 23:55:10 +02:00
julianbraha
52ad30c264 Remove unnecessary lifetimes 2024-08-30 17:53:56 +02:00
Ian Douglas Scott
4748916ff9 Make RenderElement implementations generic to reduce duplication
It would make sense to have a bound like
`for<'frame> R::Frame<'frame>: AsGlowFrame<'frame>`. But that appears to
not behave properly due to current limitations of the borrow checker:
https://blog.rust-lang.org/2022/10/28/gats-stabilization.html#implied-static-requirement-from-higher-ranked-trait-bounds

Instead, this makes `glow_frame` and `glow_frame_mut` associated
functions of the `AsGlowRenderer` trait. Then it is pretty
straightforward to make the `RenderElement` implementations generic
using that and `FromGlesError`.

It would make sense to make `Self::Error: FromGlessError` a requirement
of the `AsGlowRenderer` trait, but due to the lack of implied bounds
support, that produces a bunch of errors about missing bounds. If Rustc
improves that eventually, some bounds could be cleaned up a bit:
https://github.com/rust-lang/rust/issues/44491
2024-08-05 12:58:52 +02:00
Ian Douglas Scott
de264e250f Fix build with debug feature 2024-07-29 14:49:44 +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
ddcb435632 debug: Fix running with new kms backend 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
697ec9e1fe Use active() instead of surfaces().any in stack same_client_as
Setting the clipboard is only allowed when the keyboard focus is the
same client as the client trying to set the clipboard. We shouldn't
allow background windows in stacks to set the clipboard.

I don't know if anything else expects `same_client_as` to have this `any`
behavior.
2024-06-04 13:24:25 +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
Victoria Brekenfeld
647deb81f1 shell: Move seats into shell 2024-04-16 18:50:54 +02:00
Ian Douglas Scott
de544e1d31 Update smithay to latest commit 2024-04-09 11:26:36 +02:00
Victoria Brekenfeld
3da08ed22d stack: Adjust decorations to window geometry 2024-03-28 18:21:44 +01:00
Victoria Brekenfeld
5459f52d5e input: Rework PointerFocus to operate directly on WlSurface 2024-03-26 18:50:56 +01:00
Victoria Brekenfeld
973cfed87b shell: Handle unmapped windows correctly 2024-03-25 12:51:01 +01:00
Ian Douglas Scott
a1c8b3aa3e Add support for profiling using tracy 2024-03-20 23:55:21 +01:00
Ian Douglas Scott
658a88da8c Fix building with debug feature 2024-03-19 10:47:37 +01:00