Commit graph

785 commits

Author SHA1 Message Date
Ian Douglas Scott
d6c1ca8c33 Use &dyn to simplify pointer/keyboard/touch target dispatch
Requires https://github.com/Smithay/smithay/pull/1334.
2025-07-30 19:01:32 +02:00
Ashley Wulber
f2d6f70e13 fix: only activate the active window of the stack on activation 2025-07-22 13:31:24 +02:00
Daniel
7f814a445c
fix: Apply window snapping properly on multiple-output configurations (#1529) 2025-07-18 13:02:09 +02:00
Ian Douglas Scott
3debae2495 input/actions: Change active workspace / output when migrated
Without this, a workspace moved with the key binding seems to disappear.
This seems more consistent with the behavior of other key bindings.
2025-07-14 20:38:16 +02:00
Ian Douglas Scott
8aa501c0e0 shell: Make activate/end_workspace_swipe return Err if no set
It doesn't seem like there's really a need to have `Err(_)` and `Ok(None)`.

`Err(_)` means the set exists for the output, but doesn't have the
appropriate workspace index. It's a bit odd that the set not even
existing becomes `Ok(None)`.

Instead, just return `Err(InvalidWorkspaceIndex)` in either case.
2025-07-14 20:38:16 +02:00
Ian Douglas Scott
6f5a14e95c shell: Make activate return Some on Global workspace mode
This seems to have been returning `Ok(None)` erroneously. Fixing this
corrects output changing keybindings on global workspace mode.
2025-07-14 20:38:16 +02:00
Victoria Brekenfeld
505d9c4039 tiling: fix missing output_enter/set_bounds on remap 2025-07-14 17:38:35 +02:00
Victoria Brekenfeld
7a52eff61e workspace: Animation and geometry fixes around maximized windows 2025-07-04 19:45:54 +02:00
Victoria Brekenfeld
a7b369fab3 shell: Fix layer on maximize restore 2025-07-04 19:45:54 +02:00
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