Commit graph

405 commits

Author SHA1 Message Date
Ian Douglas Scott
5842829c59 Accumulate scroll events
Not sure the perfect way to do this; the workspace applet is a little
different.

A helper of some kind should be added to libcosmic.
2025-02-06 13:32:50 -08:00
Ian Douglas Scott
3d7d3823c4 Change workspace based on scroll events
Works, I'm not sure how many pixels to interpret as a change to the
workspace, and perhaps it should accumulate multiple deltas with a
timer. Assuming some lower level of the stack isn't doing that already.
I only see `ScrollDelta::Pixels` events, not `Lines`, though maybe
that's relevant with a different type of input device.

The behavior would also be clearer with animation, though it doesn't
seem to bad
(https://github.com/pop-os/cosmic-workspaces-epoch/issues/32).

Fixes https://github.com/pop-os/cosmic-workspaces-epoch/issues/34.
2025-02-06 13:32:50 -08:00
Ian Douglas Scott
a977667ac5 Use updated screencopy abstraction
Requires https://github.com/pop-os/cosmic-protocols/pull/46.
2025-02-04 13:58:20 -08:00
Ian Douglas Scott
ba52d69421 Add workspaces_for_output helper function 2025-01-24 15:30:15 -08:00
Ian Douglas Scott
88b35e3027 Allow dropping window onto toplevel list area
Fixes https://github.com/pop-os/cosmic-workspaces-epoch/issues/53.
2025-01-24 14:54:29 -08:00
Ian Douglas Scott
6838bd60be Remove unneeded field of DragSurface 2025-01-24 14:41:36 -08:00
Ian Douglas Scott
207e7b2ff3 Fix building mock backend 2025-01-24 14:33:04 -08:00
Ian Douglas Scott
3dc82789f5 Move drag-and-drop related types to a dnd module 2025-01-24 14:28:42 -08:00
Ian Douglas Scott
efdfaed6c8 DropTarget enum instead of tuple; combine with DragId
I guess some change is needed for handling workspaces that span outputs
(can't encode both the workspace and output id in less than 64 bits, and
need bits for discriminant as well). But that's an issue with the
previous workspace index based approach.

I wonder if `drag_id` is really needed; libcosmic could check if the
drag is in bounds of the widget, if drag surfaces can't overlap...
2025-01-24 14:09:17 -08:00
Ian Douglas Scott
f532205bf9 view: Add DragId helper to manage multiple types of destinations 2025-01-24 13:24:13 -08:00
Adam Cosner
fd0bdeebbf feat: Workspace view closing by pressing current workspace or empty space 2025-01-23 20:02:16 -08:00
Ian Douglas Scott
e032b0b5ee Center toplevels if they don't fill space 2025-01-22 13:42:04 -08:00
Ian Douglas Scott
8a4d4b6957 Have icon_for_app_id run in a background thread
This should probably be faster, but it's good for things like this to
not block the UI thread regardless.

We could probably also cache for multiple apps with the same ID. Not
sure if there's a good way to detect changes to the icon for an app id
(Not really needed, probably?)
2025-01-21 09:24:19 -08:00
Peter Krull
0c9cabd21a performance: Add app_id check to throttle icon fetch 2025-01-21 08:50:55 -08:00
Ian Douglas Scott
e3b65d4772 Remove LayerShell only once iced confirms surface destroyed
Prevents "NO VIEW" messages, and possible flicker to placeholder widget.
2025-01-16 14:50:45 -08:00
Ian Douglas Scott
a428659ade Use std LazyLock instead of once_cell crate 2025-01-16 10:21:35 -08:00
Ian Douglas Scott
b259655839 Address some warnings 2025-01-16 10:19:58 -08:00
Ian Douglas Scott
5cb9f6eb09 Allow a couple clippy lints 2025-01-15 11:56:23 -08:00
Ian Douglas Scott
392adda651 Run cargo clippy --fix 2025-01-15 11:53:59 -08:00
Vukašin Vojinović
fe1363ea42 fix(interface): align closer to designs 2025-01-15 11:49:54 -08:00
Ian Douglas Scott
764b4ae5f8 Apply screencopy transform to subsurfaces
Fixes https://github.com/pop-os/cosmic-workspaces-epoch/issues/17.
2025-01-15 10:18:50 -08:00
Ian Douglas Scott
8c4e66691c Run cargo update 2025-01-14 09:15:34 -08:00
Ian Douglas Scott
faa4a51fb9 Toplevel layout abstraction 2025-01-13 13:13:53 -08:00
Ian Douglas Scott
e1895ea3d7 Update dependencies 2025-01-13 10:42:44 -08:00
Ian Douglas Scott
b70828e23f Update iced/libcosmic 2025-01-13 10:26:45 -08:00
Ian Douglas Scott
e0c0f27f67 On mock backend, don't hide when toplevel is opened
Toplevels are only added on this backend when the workspaces view is
shown.
2024-12-16 17:55:14 -08:00
Ian Douglas Scott
81ea2f20d4 Fix building with mock-backend and no-subsurfaces 2024-12-16 17:00:09 -08:00
Ian Douglas Scott
70d6c415a1 Don't panic if dmabuf global isn't present
Fixes support for cosmic-workspaces with shm capture with no hardware
accelerated graphics present.
2024-08-07 15:01:26 -07:00
Ian Douglas Scott
c1acf0c1aa Run cargo update 2024-08-01 12:06:24 -07:00
Ian Douglas Scott
ef0d7bbc63 Close workspaces view if window spawns while open
We may want to adjust this if it sometimes leads to confusing behavior.
This may be better for now anyway.

Fixes https://github.com/pop-os/cosmic-workspaces-epoch/issues/28.
2024-07-29 22:14:47 -07:00
Ian Douglas Scott
2de366939b Correctly restrict modifiers in screencopy
Fixes issues for workspace capture in multi-gpu systems. Though I wonder
if the modifiers requested here match the render device...
2024-07-18 13:28:56 -07:00
Ryan Brue
f12fdcb17b
chore(desktop-file): remove ICED category 2024-07-18 06:07:11 +02:00
Ian Douglas Scott
686f4e764f Don't show background; rely on cosmic-comp for that
Requires https://github.com/pop-os/cosmic-comp/pull/609, or this will
show all the open windows.
2024-07-15 11:34:54 -07:00
Ian Douglas Scott
7ff45540e8 Deduplicate drag_surface code a bit 2024-07-15 11:32:07 -07:00
dengelt
a6832ef888 support CARGO_TARGET_DIR 2024-07-15 07:59:18 -06:00
Ian Douglas Scott
e9e6cc275b Move drag surface view into a function
It's a bit clearer this way.
2024-07-10 18:41:34 -07:00
Ian Douglas Scott
8e7e81bdcf Run cargo update 2024-07-10 18:29:57 -07:00
Ian Douglas Scott
594ecffa66 Apply both offset and alpha to drag surfaces 2024-06-12 09:40:13 -07:00
Ian Douglas Scott
5e6c6054a9 Run cargo update; with iced changes and new wayland-rs 2024-06-12 09:17:06 -07:00
Michael Aaron Murphy
a936ac96c1
chore: update cargo dependencies 2024-06-11 12:19:17 +02:00
Ian Douglas Scott
4a1d66dfd6 Run cargo update 2024-05-31 21:05:45 -07:00
Ian Douglas Scott
a014d8ca3d Unset drop_target after success, or close 2024-05-08 13:48:13 -07:00
Ryan Brue
7176623193 design: update workspaces icon to match pop-os/ux 2024-05-07 12:42:17 -04:00
Ryan Brue
f5b94f4862 fix(desktop): add NoDisplay=true 2024-05-07 10:34:45 -06:00
Ian Douglas Scott
30b0cfe17b Fix handling leave event to one widget after enter for another 2024-05-02 12:53:09 -07:00
Ian Douglas Scott
0f237155bf Clear drop_target when leaving drag 2024-05-02 08:05:51 -07:00
Ian Douglas Scott
d05dfd7016 Add spacing between workspaces 2024-05-02 08:05:51 -07:00
Ian Douglas Scott
ccef25c40c Use subscription for cosmic-bg-config
Works, as long as a `config_state_subscription` is used.

Should also try caching image handles.
2024-05-02 08:05:51 -07:00
Ian Douglas Scott
6cca5476ab User hover style for drop target 2024-05-02 08:05:51 -07:00
Ian Douglas Scott
b635c10837 Add offset logic, commented
With large drag surfaces, and no tranparency, this seems a bit akward
when not dragging from near top left. May be better with cursor
indicator.
2024-05-02 08:05:51 -07:00