Commit graph

776 commits

Author SHA1 Message Date
Victoria Brekenfeld
befcdadf88 floating: animation fixes 2025-07-04 19:45:54 +02:00
Victoria Brekenfeld
7988be12a5 shell: rebase fullscreen changes on for xwayland-grab 2025-07-04 19:45:54 +02:00
Victoria Brekenfeld
9d91014b8d shell: Focus window after unfullscreening 2025-07-04 19:45:54 +02:00
Victoria Brekenfeld
261134d827 shell: Correctly track was_maximized for fullscreened sticky windows 2025-07-04 19:45:54 +02:00
Victoria Brekenfeld
54e76d5ad2 shell: Don't consider animation geometry when remapping fullscreen surfaces 2025-07-04 19:45:54 +02:00
Victoria Brekenfeld
d63f1abcdd workspace: Correctly handle unmapping maximized elements 2025-07-04 19:45:54 +02:00
Victoria Brekenfeld
77084ba1cc floating: Return pending geometry on unmap 2025-07-04 19:45:54 +02:00
Victoria Brekenfeld
dec2092684 workspace: Add missing output_enter/leave events for fullscreen surfaces 2025-07-04 19:45:54 +02:00
Victoria Brekenfeld
828c0a225b shell: Fix clicking on background fullscreen surfaces 2025-07-04 19:45:54 +02:00
Victoria Brekenfeld
165f83fa38 shell: Properly restore maximized state from minimize/fullscreen 2025-07-04 19:45:54 +02:00
Victoria Brekenfeld
b11456614f shell/workspace: Don't double-remove animating fullscreen surfaces 2025-07-04 19:45:54 +02:00
Victoria Brekenfeld
5f97691ce5 xwayland: Don't allow spurious map_requests to map windows twice 2025-07-04 19:45:54 +02:00
Victoria Brekenfeld
83ed79af16 workspace: Consistently set minimized state 2025-07-04 19:45:54 +02:00
Victoria Brekenfeld
9d3678e908 shell: Ignore fullscreen requests to minimized windows 2025-07-04 19:45:54 +02:00
Victoria Brekenfeld
33044d9efb input: Add fullscreen shortcut 2025-07-04 19:45:54 +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
e5fbf21fee Remove debug prints that probably shouldn't have been merged
Also add a comment to the one place `eprintln!` is used to explain why
it's appropriate.
2025-07-03 14:25:49 +02:00
Ian Douglas Scott
30d68af051 Improved handling of XWayland grabs
A solution for https://github.com/Smithay/smithay/issues/1714.

With this, the lock screen is able to get keyboard focus normally, but
focus then reverts to the XWayland grab surface. This can be tested with
the example client from the issue.

Adding a new variant of `KeyboardFocusTarget` is annoying. Maybe it
could map to a different variant of the enum. But it presumably needs to
handle any `wl_surface` XWayland uses. (Override redirect surfaces?
Subsurfaces?) This seems as good as anything for now.
2025-07-02 11:16:53 +02:00
Ian Douglas Scott
614d99fc05 Update smithay, egui, and smithay-egui 2025-06-25 20:32:53 +02:00
Ian Douglas Scott
726994b858 Consider cursor and drag surfaces in visible_output_for_surface
This ensures that a commit to a cursor or drag surface will queue a
redraw, even if nothing else has changed on screen.

This can be tested by running `vkgears` in an otherwise empty
cosmic-comp instance, and dragging it.
2025-06-10 19:24:05 +02:00
Ian Douglas Scott
3197e52afd Unwrap user data in cursor_image_status
This is added on creation of the seat, and unwrapped, when setting the
status, so the `unwrap_or` case here seems unnecessary.
2025-06-10 19:24:05 +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
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
a65e1d6b5f debug: More profiling annotations 2025-05-27 20:00:21 +02:00
Victoria Brekenfeld
465813c1c5 shell: Using parking_lot's RwLock for fairness guarantees 2025-05-27 20:00:21 +02:00
Ian Douglas Scott
77a639624c ssd: Set is_ssd(true) on header_bar, and don't set .start 2025-05-19 21:29:51 +02:00
Victoria Brekenfeld
d8fd4b241b shell: Remove null-bytes from X11 title/app_id 2025-04-30 12:50:33 +02:00
Victoria Brekenfeld
0be83fe930 iced: Optimize updates 2025-04-28 18:03:09 +02:00
Ian Douglas Scott
96e9bf3b81 Initial support for workspace pinning and moving
Adds support for cosmic-workspace-v2 pin, unpin, move_after, and
move_before requests.

Both features need some work with workspaces span displays mode, so that
will need more fixes later.

We also want to generate a unique id for pinned workspaces to send in
the ext-workspace-v1 protocol. But that isn't a strict requirement for
anything. So I haven't yet fully implemented that. We'll also want to
persist other things, like workspace naming when that's added.

Overall, though, with separate workspaces per display, this is working
pretty well.
2025-04-24 12:45:50 +02:00
Ian Douglas Scott
d1f4e7b12d protocols/workspace: Make move_workspace_to_group move existing handle
The older protocol didn't have a way to do this, but ext-workspace-v1
supports it. And it should be the correct way to do things.
2025-04-22 07:48:23 -07:00
Victoria Brekenfeld
b53eb508a8 shell: Don't engage new MoveGrabs while in Overview 2025-04-15 16:15:24 +02:00
Victoria Brekenfeld
a8d12f3172 shell/element: Attach a resize border to tiled undecorated windows 2025-04-03 18:30:47 +02:00
Victoria Brekenfeld
cbc4ad6fc2 xwayland: Allow eavesdropping on certain keyboard/pointer events 2025-04-02 17:26:09 +02:00
Ian Douglas Scott
0c95871bd0 shell/workspace: Disambiguate output with edid match by connector name
If two displays have the same edid (which shouldn't happen, since edid
includes a serial number, but is somewhat common in practice with
identical monitors), match output stack by comparing both edid and
connector name.

If we get the same edid but a different connector, `set_output`
truncates but also adds the new one. (Before adding edid matching, this
would have just added to the output stack.)

`prefers_output()` will requrire a connector name match if the edid of
the current output is the same as that of the output being compared.
2025-04-02 13:40:56 +02:00
Ian Douglas Scott
70ed075e80 shell/workspace: Store edid in output stack
Matches by edid where present, or by connector name if there is no edid
information.
2025-04-02 13:40:56 +02:00
Ian Douglas Scott
75aab6e282 shell/workspace: Clear output stack when moved user moves workspace
If the user explicitly moves a workspace to an output, assume that is
where the user wants it, so it shouldn't be moved back to a different
output in the future.

For persistent workspaces, the explicitly set workspace is the one that
will be stored, instead of trying to track an unbounded list of outputs
persistently.
2025-04-02 13:40:56 +02:00
Victoria Brekenfeld
c072538a6e a11y/zoom: Fix settings page 2025-03-28 18:35:06 +01:00
Victoria Brekenfeld
ec60933e01 a11y/zoom: Add more leeway for OnEdge movement 2025-03-28 18:35:06 +01:00
Victoria Brekenfeld
0ba0a0cdaa a11y/zoom: zoom level per output 2025-03-28 18:35:06 +01:00
Victoria Brekenfeld
b62e47ef8d a11y/zoom: Allow hiding the overlay 2025-03-28 18:35:06 +01:00
Victoria Brekenfeld
d46ed304b8 shell: Unmaximize when moving a single window to another tiling layer 2025-03-27 11:57:17 +01:00
Victoria Brekenfeld
5cef49d2ce shell: Unmaximize windows on the target workspace when moving groups 2025-03-27 11:57:17 +01:00
Victoria Brekenfeld
9ee701ee64 shell: Don't move group to tiled layer of floating-only workspace 2025-03-27 11:57:17 +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
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