Commit graph

6639 commits

Author SHA1 Message Date
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
7a1f8b3472
examples/sctk_subsurface_img: Toggle image/subsurface with key 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
Ian Douglas Scott
d0b4d0e9c9
examples: Add sctk_subsurface_img
Test scrolling. Single color buffers in `sctk_subsurface` aren't good
for comparing it, and `sctk_subsurface_gst` isn't working on latest gst
with explicit sync (and AppSync isn't accepting the dmabuf when I try to
modify it.)
2026-01-27 16:26:09 -05:00
Ian Douglas Scott
5865264964
examples: Update gstreamer 2026-01-27 16:26:08 -05:00
Ian Douglas Scott
e702c43f71
examples: Update sctk_subsurface_gst to compile again 2026-01-27 16:26:08 -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
Juniper
89af847930
Remove Cargo.lock 2026-01-26 18:42:54 -05:00
Héctor Ramón Jiménez
199277921a
Implement markdown incremental code highlighting
(cherry picked from commit 4b8fc23840)
2026-01-26 18:41:29 -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
Héctor Ramón Jiménez
0b068e486e
Infinite List widget from upstream feature/list-widget-reloaded branch 2026-01-26 13:10:42 -05:00
Ashley Wulber
6829724ac0
fix: send pointer motion event for pointer enter event 2026-01-26 12:51:02 -05:00
Victoria Brekenfeld
19ff21d298
wgpu: Fix explicit nvidia device selection 2026-01-26 12:51:01 -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
Vukašin Vojinović
b775402f65
feat(scrollable): add padding to ends of scrollbar
This adds a padding field to the scrollbar, which adds padding at the start and end of scrollbars, without affecting the scrollable. This enables the scrollable to use the full height/width of a container where it would otherwise be visually restricted by scrollbar placement (e.g. due to rounded corners).
Also adds methods for changing scrollbar/scroller width, allowing to match defaults to upstream, while making required changes in libcosmic.
2026-01-26 12:13:27 -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
Ashley Wulber
5b0468e535
refactor: include virtual offset in Layout 2026-01-26 11:48:10 -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
Adam Cosner
0f37c9922d
perf: use cached alpha mode instead of calling surface.get_capabilities every time the window is redrawn 2026-01-23 14:50:36 -05:00
Sosthène Guédon
46c745be2c
Add focus id to text editor 2026-01-23 14:50:32 -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
3cdcfe79db
Update cctk to latest commit 2026-01-23 14:46:29 -05:00
Ian Douglas Scott
592f17729c
mouse_area: Fix on_drag behavior without on_release
Mouse/touch release events should end the drag even if there's not an
`on_release` callback.

This was causing https://github.com/pop-os/cosmic-comp/issues/1071.
2026-01-23 14:44:58 -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
bd6c04d809
Don't use Box<Arc<_>> and Arc::into_inner unnecessarily 2026-01-23 14:03:53 -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
Ashley Wulber
6cffd2f452
fix: use total_cmp where possible 2026-01-23 13:47:39 -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