Commit graph

461 commits

Author SHA1 Message Date
Victoria Brekenfeld
091583ac84 backend: Support wl-dmabuf v6 2026-07-29 22:08:23 +02:00
zyads
ffeda3375a fix(corner_radius): check LayerHookId for layer surfaces
GetCornerRadiusLayer looked up the existing hook via ToplevelHookId while
inserting into LayerHookId a few lines later. Both are
Mutex<Option<(HookId, Weak<..>)>> so it compiles, but they are distinct
data_map slots: the "does this surface already have a corner-radius object?"
check for a layer surface read the toplevel slot, so it could not see a layer
object that was already there, and it created a toplevel entry on a layer
surface as a side effect.

Every other read of the layer hook already uses LayerHookId.

Disclosure: found and written with AI assistance (Claude). The change is the
one line quoted above; I understand it and verified the tree builds with it.
2026-07-29 00:30:01 +02:00
RipleyTom
6108cef8b3 fix: workaround for Chromium apps breaking below 1.0 scaling 2026-07-25 01:13:59 +02:00
littlezabi
1d72227a30 fix: release active popup grabs on toplevel destruction
If a window with an active popup grab is closed or crashes unexpectedly, the input grab state can get stuck, freezing keyboard and mouse clicks.
    This patch iterates over all seats and releases the active seat grab if it is owned by the destroyed window or one of its child popups.

Signed-off-by: littlezabi <zohaibjozvi@gmail.com>
2026-07-21 18:04:33 +02:00
Ian Douglas Scott
d7d6be3cdb image-copy: Only embed cursor in toplevel capture if focused 2026-07-21 17:02:58 +02:00
Ian Douglas Scott
2648aea0df image-copy: Move duplicate code to a cursor_capture_constraints()
This ensures we avoid advertising a `0,0` buffer size (which will
protocol error to actually allocate), and avoids defining the supported
formats for cursor capture buffers in a bunch of places.
2026-07-21 17:02:58 +02:00
Ian Douglas Scott
27956e6e00 Make cursor_geometry() return a CursorGeometry struct
A bit better than just a tuple.
2026-07-21 17:02:58 +02:00
Ian Douglas Scott
dd6ebd03c9 image-copy: Hold references to Buffers to block release
The `wl_buffer` now won't be released until sync fence polls ready.
2026-07-21 17:02:58 +02:00
Ian Douglas Scott
d84d5d46ce image-copy: Use seat from WlPointer instead of last_active() 2026-07-21 17:02:58 +02:00
RipleyTom
8955024bff Fix: improve edge pointer accuracy 2026-07-21 15:50:19 +02:00
Vukašin Vojinović
d41124a51d chore: clippy fixes 2026-07-18 09:09:30 +02:00
Victoria Brekenfeld
2d95d46a37 chore: formatting fixes 2026-07-16 19:43:10 +02:00
Victoria Brekenfeld
8ab946f10a chore: clippy fixes 2026-07-16 19:43:10 +02:00
Ashley Wulber
8f82cade68 cleanup: remove attempts to force redraw
They seem to always fail anyways and it has no negative effect as far as I can tell
2026-07-15 14:48:33 -04:00
Victoria Brekenfeld
3e17157ccf chore: update smithay 2026-07-09 18:08:01 +02:00
Victoria Brekenfeld
f6cb4519a0 render/blur: Cache native texture type 2026-07-09 18:08:01 +02:00
Ashley Wulber
b890f7b0fa fix(corner_radius): loosen padding size constraint 2026-07-09 18:08:01 +02:00
Ashley Wulber
77f57a656d fix: pad_rect typos 2026-07-09 18:08:01 +02:00
Victoria Brekenfeld
5ee2fa911a wayland: Support cosmic-corner-radius v2 2026-07-09 18:08:01 +02:00
Victoria Brekenfeld
cfed174e9b chore: Fix clippy lints 2026-07-09 18:08:01 +02:00
Victoria Brekenfeld
de8b47839c render: Make blur_strength configurable 2026-07-09 18:08:01 +02:00
Victoria Brekenfeld
1c5ef576f4 render: Don't use separate damage_output calls 2026-07-09 18:08:01 +02:00
Victoria Brekenfeld
a9bf89d8b2 element/wayland: Add blur background-effect 2026-07-09 18:08:01 +02:00
Victoria Brekenfeld
e4c0716951 element: Refactor element acquisition to be push based 2026-07-09 18:08:01 +02:00
Victoria Brekenfeld
178c6593dc element: Introduce SurfaceRenderElement 2026-07-09 18:08:01 +02:00
Victoria Brekenfeld
8b990e5658 render: Merge FromGlesError into AsGlowRenderer 2026-07-09 18:08:01 +02:00
Ian Douglas Scott
f765696834 Avoid unnecessarily unwrapping stack_ref() after is_stack()
In a lot of cases, matching on `stack_ref()` also works.
2026-07-07 17:46:23 -07:00
Ian Douglas Scott
29320bdab5 Add cosmic-keyboard-layout-unstable-v1 protocol
https://github.com/pop-os/cosmic-protocols/pull/28

Allows clients like `cosmic-applet-input-sources` to show which layout
group is active and update it. Currently this is implemented by update
the `xkb_config` to change the layout order.
2026-07-07 16:44:09 +02:00
Hojjat Abdollahi
9d52653d5c
revert: "fix: follow the focus after alt+tab to another output"
This reverts commit 56f84fba2d.
2026-07-02 17:53:03 +02:00
Ilia Malanin
aac1e19f08 fix: set_rectangle leak 2026-06-18 13:37:14 -04:00
Victoria Brekenfeld
106b50293b wayland/activation: Fix requests without active outputs 2026-06-18 18:29:37 +02:00
Skygrango
b6cab38528 wayland: implement pointer_warp_v1 2026-06-16 14:49:28 -06:00
Gavin John
d4c5714c10 perf(toplevel_info): optimize send_toplevel_to_client
PR #1279 tried to throttle `send_toplevel_to_client`, which was rejected. This takes (what I think is) a better approach, and instead makes some optimizations. We delay grabbing the mutex until it's actually needed, and we also checks to see if the state actually needs to be resent. This resolves some lock contention, and also avoids having to generate the state in the first place. Since `wayland-rs` uses a single mutex to lock the entire state, this both massively reduces lock contention and avoids making (apparently quite a lot of) unnecessary computation.

I decided to give this one to AI since I'm a bit busy right now (although I am still manually writing the commit messages and descriptions). I think it generally did a pretty good job, although I did have to make a few manual tweaks. While I don't have any empirical data, cosmic-comp idle CPU has gone down from ~3% all-core to 0-0.5%, even stress testing it with far more windows open. I can't say it *liked* opening 30-some windows in 2 seconds, but after it finished opening them all, it was still buttery smooth. Overall very happy with the results.

Assisted-by: Claude:claude-4-opus
2026-06-16 18:09:28 +02:00
Ian Douglas Scott
82dcd9a46a image-copy: Don't send 0x0 buffer params for cursor capture
Fixes panics in `xdg-desktop-portal-cosmic` when it tries to use cursor
capture, and an application hides the cursor.
2026-06-09 10:42:48 -07:00
Robin Nehls
2f7c34f29a feat: add config option for xdg activation behavior 2026-06-03 08:09:29 +02:00
Hojjat
56f84fba2d fix: follow the focus after alt+tab to another output 2026-06-02 12:14:39 -06:00
Hojjat Abdollahi
28ef6bdbc8
feat: support multiple fullscreen windows per workspace 2026-06-02 17:48:33 +02:00
Skygrango
208c2128cd wayland: implement new_constraint, remove_constraint and cursor_position_hint for PointerConstraintsHandler
new_constraint: check if the surface has pointer focus, keyboard focus, and if the pointer is within toplevel geometry or constraint region. If these conditions are met, then enable the constraint.

remove_constraint: apply last cursor position hint that saved in seat.

cursor_position_hint: save the cursor position hints provided by the client to the seat.
2026-06-01 07:52:42 -07:00
Victoria Brekenfeld
85630236fa xwm: Support sticky requests for unmapped windows 2026-05-19 19:26:25 +02:00
Ian Douglas Scott
4106904a7e chore: Update smithay with Dispatch2 2026-05-19 19:26:25 +02:00
KENZ
677be79635 Unconstrain the IME popup when it appeared, resized, requested to
repositioned

- places the IME popup correctly.
- adjusts its position to considering the output (screen) rect.
  - offset if right edge overflows
  - flip vertically if bottom edge overflows
2026-05-07 15:00:24 -06:00
KENZ
7a10fb1cc8 refactor: change PopupSurface args to PopupKind of position_popup_within_rect() paths
- to support InputMethod popup kind in later commit
2026-05-07 15:00:24 -06:00
KENZ
f62c88a3d9 refactor: unify popup positioning logic for tiled layout into
position_popup_within_rect()
2026-05-07 15:00:24 -06:00
KENZ
1a57c104f6 refactor: extract positioning popups within global rect logic
- preparation to make unconstrain_popup() PopupKind agnostic
2026-05-07 15:00:24 -06:00
KENZ
977d4c2dca refactor: make get_popup_toplevel() PopupKind agnostic
- for preparation to make unconstrain_popup() PopupKind agnostic.
2026-05-07 15:00:24 -06:00
Ian Douglas Scott
472ffa5f30 image-copy: Don't panic if ImageCaptureSourceKind udata is undefined
We want to merge this when updating Smithay to have
https://github.com/Smithay/smithay/pull/1961, so that we don't panic the
the output/toplevel already has no strong references when the source is
created.
2026-04-27 14:51:46 -07:00
Hojjat
3e84968dac fix: clean up pending_windows for surfaces that were never mapped 2026-04-07 16:14:52 +02:00
Victoria Brekenfeld
e1ff0309c7 wayland/image-copy-capture: Break toplevel reference cycle 2026-03-27 12:45:43 +01:00
Ian Douglas Scott
7fa5bd6b91 image-copy: Do not panic on ImageCaptureSourceKind::Destroyed
The way this was handled previously is incorrect. We should still handle
creation of a capture session, just send `stopped` when it is created.

This can be tested by creating a capture source and session for a
workspace that has been removed. Toplevel and output sources have a
different issue in `smithay`: https://github.com/Smithay/smithay/pull/1961

Should fix https://github.com/pop-os/cosmic-epoch/issues/3319.
2026-03-26 18:23:20 +01:00
Vukašin Vojinović
2ca99c670a chore: clippy 2026-03-18 18:19:03 +01:00