Commit graph

740 commits

Author SHA1 Message Date
Ashley Wulber
e73bbddbca
feat(wayland): corner-radius protocol support 2026-01-27 17:17:08 -05:00
Ashley Wulber
54a69a0523
feat(wayland): shortcut inhibit 2026-01-27 17:00:24 -05:00
Ashley Wulber
8e7b7e586f
feat: subsurface reposition 2026-01-27 16:26:11 -05:00
Ashley Wulber
4eb7f9b2fe
fix(wayland popup): apply input region 2026-01-27 16:26:11 -05:00
Ian Douglas Scott
9e45bd2378
winit/sctk: Update cursor position on touch event
Ideally pointer should be seperate from touch, but this should match how
Iced handles input in normal winit windows.

d475ae5b45/winit/src/window/state.rs (L165-L170)

With this, touch input for applets seems to work as expected in general.
2026-01-27 16:26:10 -05:00
Ian Douglas Scott
5924fea0b1
Revert "subsurface_widget: Handle viewport and set source rectangle"
This reverts commit 15547dec8f83af1ea6dbed1964302400fc17c257 from
https://github.com/pop-os/iced/pull/227.

This is causing issues in `cosmic-workspaces`. It seems I didn't test it
properly outside the examples here... and this misinterpreted exactly
what the (undocumented) `viewport` argument means (Iced's `image` widget also
needed a fix to handle viewports properly since our fork:
https://github.com/iced-rs/iced/pull/2752).

It should be possible to fix, but revert for now.
2026-01-27 16:26:10 -05:00
Ian Douglas Scott
58f6ea3f08
subsurface_widget: Handle viewport and set source rectangle
This is needed to crop subsurface when needed, instead of rendering
overlapping other things. And to offset while scrolling.
2026-01-27 16:26:09 -05:00
Ashley Wulber
29b41e9776
chore(sctk): reduce severity of log messages 2026-01-27 16:20:42 -05:00
Ashley Wulber
e4f8120eed
improv(sctk): setup error handling 2026-01-27 16:20:36 -05:00
Ashley Wulber
9668aeba1f
fix: nested popup destruction 2026-01-27 16:08:23 -05:00
Ian Douglas Scott
78153e6240
fix(winit): Cleanup surface_subsurfaces on parent window removal 2026-01-27 16:08:16 -05:00
Jeremy Soller
3553fa2c01
Format 2026-01-26 13:11:55 -05:00
Jeremy Soller
6de3237687
support CapsLock modifiers on wayland 2026-01-26 13:11:28 -05:00
Ashley Wulber
6829724ac0
fix: send pointer motion event for pointer enter event 2026-01-26 12:51:02 -05:00
Ashley Wulber
ad0523230e
fix: reset control flow if the loop is about to wait with nothing to do. 2026-01-26 12:50:53 -05:00
Ian Douglas Scott
53fed52405
wayland: Set cusor position on Enter events
Fixes https://github.com/pop-os/cosmic-workspaces-epoch/issues/143.

The way some events are converted to `WindowEvent`s in `pointer_frame`
but motion is handled in `SctkEvent::process` seems a little cluttered
at the moment, I guess from how this code was ported to be part of
iced-winit instead of separate. But as I understand, the code handling
`PointerEventKind::Enter` in `SctkEvent::enter` wasn't being called, so
that can be replaced with the new code here that sets the logical cursor
position.
2026-01-26 12:13:32 -05:00
Ian Douglas Scott
f04e237946
subsurface_widget: Use neagtive z to place below parent surface
Now uses `i32` for `z`.
2026-01-26 11:56:40 -05:00
Ian Douglas Scott
02bd5d17ef
subsurface_widget: Sort parent WlSurface, not ObjectId 2026-01-26 11:56:37 -05:00
Ian Douglas Scott
9f07d15617
subsurface_widget: Fix use of place_above
`place_above` moves the subsurface within the stack of subsurfaces, so
calling it for all previous surfaces is wrong.

We also need to use the `z` from `view_subsurfaces` if this is called
before `attach_and_commit`, or an old value will be used.
2026-01-26 11:48:15 -05:00
Jeremy Soller
7120db60ba
Format 2026-01-26 10:14:19 -05:00
Ashley Wulber
4db71cb0e6
fix: create fractional scale for sctk subsurfaces 2026-01-23 15:39:42 -05:00
Ashley Wulber
93bc4bbd88
feat: subsurfaces 2026-01-23 15:39:35 -05:00
Ian Douglas Scott
49b154c048
winit/wayland: Update for toplevel-info cctk changes 2026-01-23 14:47:54 -05:00
Ian Douglas Scott
1f93ae8c3f
winit: Fix building without wayland feature 2026-01-23 14:39:31 -05:00
Ian Douglas Scott
a1792b681a
winit/wayland: Apply scale when creating drag surface 2026-01-23 14:36:40 -05:00
Ian Douglas Scott
b4168e69cc
Add an offset to IconSurface, so icon can be offset from custor 2026-01-23 14:34:16 -05:00
Ian Douglas Scott
ed5de12e69
runtime: Remove start_dnd
This is not currently used. And is impossible to (soundly) use, since it
requires a `Send` bound, which `State` and `Element` lack.
2026-01-23 14:07:12 -05:00
Ian Douglas Scott
fde0689def
winit/wayland: Subsurfaces for drag surfaces
Use `Icon::Surface` instead of `Icon::Buffer`, so we can then create
subsurfaces of the `wl_surface`.

Using `.screenshot()` then copying to an shm buffer is suboptimal, but
this does seem overall better than with the older Iced version when a
drag surface didn't appear until a Vulkan surface could be created for
it.

This re-uses `Connection` in the platform-specific code, instead of
creating from display handle on each call.
2026-01-23 14:00:38 -05:00
Ian Douglas Scott
545ecb8a8a
Remove unused destroyed_surface_ids 2026-01-23 13:47:40 -05:00
Ian Douglas Scott
288919958e
subsurface: Add option to apply buffer transform 2026-01-23 13:47:38 -05:00
Ian Douglas Scott
e034001468
subsurface: Remove width/height arguments to Subsurface::new
In an earlier version, this took a `WlBuffer`, so the width/height
arguments were needed. But since using the same `wl_buffer` multiple
times conflicted with `release` handling we instead accept
`SubsurfaceBuffer`, which stores the same height/width.
2026-01-23 13:47:37 -05:00
Ian Douglas Scott
c7dd111ae8
subsurface: Add width/height methods to SubsuraceBuffer
This is potentially useful.

Other properties are specific to shm/dmabuf, and not meaningful in
general.
2026-01-23 13:47:34 -05:00
Ian Douglas Scott
18f0521357
subsurface_widget: Remove subsurface_ids
This was previously needed, but should be redundant now that an empty
input region is set for the subsurface. With that, the subsurface should
never get input events, so mapping them isn't needed.
2026-01-23 13:33:59 -05:00
Ian Douglas Scott
dd9576d94e
subsurface_widget: Clear subsurface list after calls to ::draw()
Otherwise the `draw` call in response to `AboutToWait` causes this list
to grow, and eventually hit errors in `sendmsg` due to too many buffered
file descriptors from creating subsurfaces.

Probably the number of places `UserInterface::draw` are called should be
cleaned up. And it shouldn't be called in `AboutToWiat` like this. Some
improvements could probably be made in upstream iced.
2026-01-23 13:33:42 -05:00
Ian Douglas Scott
c18f5f6dda
subsurface_widget: Take owned SubsurfaceBuffer
This type is an `Arc`, so there's no major benefit to using a reference,
or a `Cow` to make it generic.

Drag surfaces currently require a `'static` `Element`, so this is needed
their.
2026-01-23 13:12:06 -05:00
Ashley Wulber
dbbaa4f442
fix(winit): cleanup layer surface dnd surface 2026-01-23 13:11:54 -05:00
Ashley Wulber
8e08ceb25c
fix: convert sctk configure events to Opened and Resized 2026-01-23 11:30:54 -05:00
Ashley Wulber
39d88f2ffa
refactor: add namespace 2026-01-23 11:28:35 -05:00
Ashley Wulber
301892aaa5
feat: overlap notify 2026-01-23 11:25:32 -05:00
Ashley Wulber
6e91eabf4c
refactor: use cctk 2026-01-23 11:16:56 -05:00
Matt George
1b8a399ebd
use a variable instead of a fn for hard-coded check 2026-01-23 11:11:22 -05:00
Matt George
c984005e9b
hard-code which targets have drag_resize support
This replaces the previous check which appeared to rely on the assumption that initiating a drag_resize without a left mouse press wouldn't actually start a resize (this assumption is false on Windows).
2026-01-23 11:11:22 -05:00
Matt George
5ca1838a2d
fix: correct event types for windows 2026-01-23 11:09:50 -05:00
Ashley Wulber
c0473f8a91
fix: rebuild a11y tree when rebuilding widget tree 2026-01-23 11:07:45 -05:00
Ashley Wulber
eff664a035
fix: request logical size when autosizing 2026-01-23 10:51:41 -05:00
Ian Douglas Scott
db8e74b7a3
Send KeyboardEventVariant::Enter on keyboard enter
`cosmic-osd` expected this event, but it wasn't being sent. This isn't
hard to fix, unless there's some non-obvious issues that this was
commented to avoid (that is still applicable).
2026-01-23 10:25:19 -05:00
Ashley Wulber
83910ff5b0
refactor: allow apps to request to be treated as a daemon 2026-01-23 10:25:03 -05:00
Ashley Wulber
3cb4e4674e
fix: close subscriptions when exiting 2026-01-22 14:06:37 -05:00
Eduardo Flores
61cdb6fe1f
fix: use enable and disable methods 2026-01-21 15:04:37 -05:00
Eduardo Flores
344567dd8d
improv: expose set_blur 2026-01-21 14:58:08 -05:00