Commit graph

66 commits

Author SHA1 Message Date
mikairyuu
1dc9c53a41 x11: stop remapping minimized windows on restore
The remap-on-restore workaround was introduced in 3b9d0ce
("HACK: Remap minimized X11 windows on restore"), but forcing an
unmap/map cycle on unminimize now regresses Steam: restoring a
non-fullscreen window can leave the main surface black while input
and tooltips still work.

Keep the existing X11 hidden-state handling and only drop the
forced remap cycle. This preserves the newer minimize/unminimize
signaling for X11 clients while avoiding an extra restore-time
remap.
2026-03-10 17:06:28 +01:00
Ian Douglas Scott
612ff2f523 layout/floating: In unmap, don't alter size if no pending changes
If the intent here was that the `if let` would only handle the case
where there are pending changes, then something like this should be
right.

Seems to fix behavior in
https://github.com/pop-os/cosmic-comp/issues/1819.
https://github.com/pop-os/cosmic-comp/issues/1645 may be the same issue.
2026-01-08 16:51:59 -07:00
Victoria Brekenfeld
dc5a9fac66 element/surface: Simplify surface feedback selection using the frame_time_filter 2026-01-08 00:20:18 +01:00
Victoria Brekenfeld
d17a4ead68 kms/surface: Simpify surface feedback creation 2026-01-08 00:20:18 +01:00
Victoria Brekenfeld
77d3605fb9 Update smithay for DnD updates 2025-12-04 20:17:12 +01:00
Ian Douglas Scott
282d76ef34 Set X11Surface hidden when a surface is minimized
This seems for an SDL XWayland client to restore fullscreen after
unminimize, it needs to see the `_NET_WM_STATE_HIDDEN` state get set
and unset.

In general `_NET_WM_STATE_HIDDEN` does not seem to cover all the
cases covered by waylands "suspended" state, so let's not equate them.

https://github.com/pop-os/cosmic-comp/issues/1510
2025-11-18 22:26:04 +01:00
Ian Douglas Scott
e129094bfb Update smithay
Updates for `last_acked`, etc. API changes in
https://github.com/Smithay/smithay/pull/1817.

Includes layer shell fixes
from https://github.com/Smithay/smithay/pull/1819.
2025-11-11 21:27:57 +01:00
Ian Douglas Scott
9816b18259 Define a with_toplevel_state, generic over pending bool
Reduces a bit of duplication.
2025-11-11 21:27:57 +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
242e465d42 fix(corner-radius): use cached state 2025-10-03 20:11:16 +02:00
Ashley Wulber
e476153086 fix(outline): pass the radii in the correct order for the shader 2025-10-03 20:11:16 +02:00
Ashley Wulber
2873d6b27e fix(corner-radius): properly handle no value, and use geometry 2025-10-03 20:11:16 +02:00
Ashley Wulber
2d9d83d3bd fix(corner-radius): guard against corner radius being too large 2025-10-03 20:11:16 +02:00
Ashley Wulber
f01ebf2f6f refactor(corner-radius): corner_radius method for CosmicSurface 2025-10-03 20:11:16 +02:00
Victoria Brekenfeld
c3d2b5f0b7 element: Allow overriding default scanout behaviour 2025-08-07 19:40:23 +02:00
Victoria Brekenfeld
be1424f1ca render/wayland: filter scanout candidates by frametime estimation 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
Victoria Brekenfeld
b5e60fcde5 wayland/decorations: Fix xdg-decoration state always shadowing kde-decorations 2025-05-30 17:28:51 +02:00
Victoria Brekenfeld
c5708cd607 wayland/decorations: Fix early requests with kde-protocol 2025-05-28 14:38:30 +02:00
Victoria Brekenfeld
d8fd4b241b shell: Remove null-bytes from X11 title/app_id 2025-04-30 12:50:33 +02:00
Victoria Brekenfeld
95b27637ae chore: smithay update 2025-03-12 16:50:58 +01:00
Victoria Brekenfeld
df74a322ab mapped: Allow to query in-flight configure for resize throttling 2025-01-16 19:44:12 +01:00
Victoria Brekenfeld
6be5009b37 kms: Allow diverging primary plane formats under certain conditions 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
fc84fa9948 shell: Fix windows global geometry to include ssd 2024-12-05 18:20:10 +01:00
Victoria Brekenfeld
51c8588f89 render: Use render_input_order 2024-10-22 19:43:47 +02:00
Victoria Brekenfeld
9c7c41c508 toplevel-info/mgmt: Update to v2/v3 2024-09-23 10:55:00 +02:00
Ashley Wulber
b8eaf5dcb4 chore: update smithay 2024-08-02 15:54:05 +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
Victoria Brekenfeld
3b9d0ce3d7 HACK: Remap minimized X11 windows on restore 2024-07-10 22:36:40 +02:00
Victoria Brekenfeld
bf6ea3414b x11surface: Unmap on minimize 2024-07-10 22:36:40 +02:00
Victoria Brekenfeld
e78e199663 chore: Update smithay for thread-safety 2024-06-26 12:59:33 +02:00
Ryan Brue
6ca1a37a53 design: Make server side decorations compact 2024-05-30 23:05:34 +02:00
Ian Douglas Scott
0c54511477 Invert is_decorated test in min_size/max_size
It looks like these if conditions assumed `true` mean "has SSDs". But it
actually means the surface is client-side decorated.
2024-05-29 06:26:41 -06: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
cf75bc1952 chore: Update smithay/libcosmic 2024-03-26 18:50:56 +01:00
Victoria Brekenfeld
6858238bd6 shell: Unify element_for_(x11_|wl_)surface 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
Victoria Brekenfeld
3eb7e5f82e shell: implement minimize 2024-03-04 19:20:52 +01:00
Victoria Brekenfeld
afa7ad6d6a window: Add ssd interactive resize 2024-03-04 13:19:57 +01:00
Ian Douglas Scott
3036448c19 Update Smithay, with Window that supports X11 surfaces 2024-02-22 17:49:46 +01:00
Victoria Brekenfeld
37623f063f element: Don't send configure for X11 surfaces 2023-11-23 12:57:42 +01:00
Victoria Brekenfeld
14867a0893 xdg-activation: Switch stack focus 2023-11-14 19:43:06 +01:00
Victoria Brekenfeld
5b7efa3a8b floating: Restore size of moved maximized windows correctly 2023-10-25 19:41:55 +02:00
Victoria Brekenfeld
42aaafe586 utils: New geometry spaces local/global 2023-10-25 19:41:55 +02:00
Ian Douglas Scott
373af07319 Implement pointer constraints; update to send frame manually 2023-09-29 19:21:13 +02:00
Ian Douglas Scott
e1fc182c3e Update Smithay 2023-09-13 20:24:11 -07:00