Commit graph

1832 commits

Author SHA1 Message Date
Ian Douglas Scott
55401b1e53 dbus: Use ThreadPool instead of zbus blocking API
The `zbus` blocking API just wraps the async API with `block_on`, so we
may as well use our own executor.
2025-11-24 13:53:05 -08:00
Ian Douglas Scott
8455869439 Add a ThreadPool async executor to State
If we need to use simple async code in a few places, a single executor
may be better than having several threads blocking on async code.

This should probably use the calloop executor, but that's had issues in
cosmic-workspaces, though that may not apply here.
2025-11-24 13:53:05 -08:00
Hosted Weblate
f0bab4a40b i18n: translation updates from weblate
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: jonnysemon <jonnysemon@users.noreply.hosted.weblate.org>
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-comp/ar/
Translation: Pop OS/COSMIC Comp
2025-11-24 17:55:58 +01:00
Hosted Weblate
ed3efe3d29 i18n: translation updates from weblate
Co-authored-by: jonnysemon <jonnysemon@users.noreply.hosted.weblate.org>
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-comp/ar/
Translation: Pop OS/COSMIC Comp
2025-11-24 12:10:28 +01:00
Victoria Brekenfeld
8624928052 gestures: Cycle through workspaces 2025-11-21 09:10:01 -07:00
Victoria Brekenfeld
1f2863fa18 xwayland: Fix unscaled dpi setting 2025-11-21 09:09:21 -07:00
Hosted Weblate
b9d7870f71 i18n: translation updates from weblate
Co-authored-by: jonnysemon <jonnysemon@users.noreply.hosted.weblate.org>
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-comp/ar/
Translation: Pop OS/COSMIC Comp
2025-11-21 16:58:29 +01:00
Ian Douglas Scott
282d76ef34 Set X11Surface hidden when a surface is minimized
This seems for an SDL XWayland client to restore fullscreen after
unminimize, it needs to see the `_NET_WM_STATE_HIDDEN` state get set
and unset.

In general `_NET_WM_STATE_HIDDEN` does not seem to cover all the
cases covered by waylands "suspended" state, so let's not equate them.

https://github.com/pop-os/cosmic-comp/issues/1510
2025-11-18 22:26:04 +01:00
Hosted Weblate
1f9c130410 i18n: translation updates from weblate
Co-authored-by: ANTOINE Daniel <univac55@gmail.com>
Co-authored-by: Aisyk <aisyko@gmail.com>
Co-authored-by: Feike Donia <feikedonia@proton.me>
Co-authored-by: GerardWassink <gerard.wassink@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Julien Brouillard <julienbrouillard1@gmail.com>
Co-authored-by: twlvnn kraftwerk <kraft_werk@tutanota.com>
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-comp/bg/
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-comp/fr/
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-comp/nl/
Translation: Pop OS/COSMIC Comp
2025-11-18 13:01:45 +01:00
Hosted Weblate
83ee2a6953 i18n: translation updates from weblate
Co-authored-by: ANTOINE Daniel <univac55@gmail.com>
Co-authored-by: Aisyk <aisyko@gmail.com>
Co-authored-by: Feike Donia <feikedonia@proton.me>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Julien Brouillard <julienbrouillard1@gmail.com>
Co-authored-by: twlvnn kraftwerk <kraft_werk@tutanota.com>
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-comp/bg/
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-comp/fr/
Translation: Pop OS/COSMIC Comp
2025-11-17 12:10:26 +01:00
Victoria Brekenfeld
1c74adf772 chore: smithay update 2025-11-14 09:14:22 +01:00
Ashley Wulber
04d3e1ed59 fix(popup): avoid panic when None
cosmic-comp panics here after launching an app from the app tray overflow popup. While it may indicate a panel issue that I also need to look into, it seems to work fine if we don't unwrap on this option.
2025-11-13 17:58:37 -05:00
Victoria Brekenfeld
84f1d6b7a9 shell: Change fullscreen restore info on move 2025-11-13 09:33:50 -07:00
Victoria Brekenfeld
c1e5a3ee3d shell: Tile windows moved to a tiled workspace 2025-11-13 09:33:50 -07:00
Victoria Brekenfeld
7e63b99cd5 shell: Moved minimized windows should stay minimized 2025-11-11 20:20:54 -07:00
Victoria Brekenfeld
5fc5a223c7 shell: Remove minimized state on unmap 2025-11-11 20:20:54 -07:00
Victoria Brekenfeld
41d0cd8d2b layout/tiling: Fix crash swapping across workspaces 2025-11-11 20:20:04 -07:00
Victoria Brekenfeld
e5ea486ea0 shell/stack: Don't reset previous_keyboard on noop set_active call 2025-11-11 20:18:58 -07:00
Peter Krull
6c01631f51 cargo fmt 2025-11-11 20:12:22 -07:00
Peter Krull
fc9fe59ed9 Fix bars when full screen, reposition popups 2025-11-11 20:12:22 -07:00
Ian Douglas Scott
e129094bfb Update smithay
Updates for `last_acked`, etc. API changes in
https://github.com/Smithay/smithay/pull/1817.

Includes layer shell fixes
from https://github.com/Smithay/smithay/pull/1819.
2025-11-11 21:27:57 +01:00
Ian Douglas Scott
9816b18259 Define a with_toplevel_state, generic over pending bool
Reduces a bit of duplication.
2025-11-11 21:27:57 +01:00
Hosted Weblate
25763439db i18n: translation updates from weblate
Co-authored-by: twlvnn kraftwerk <kraft_werk@tutanota.com>
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-comp/bg/
Translation: Pop OS/COSMIC Comp
2025-11-10 12:24:46 +01:00
Ashley Wulber
e55d16b87b fix: unset grab if focusing exclusive layer shell surface 2025-11-05 15:49:22 +01:00
Ian Douglas Scott
7fd033295f focus-stack: Keep dragged surface in focus stack in move_request()
Replacement for https://github.com/pop-os/cosmic-comp/pull/1687, that
works correctly with multiple outputs.

We don't want another window to show a focus indicator while a window is
being dragged, so keep the window in the focus stack. If a window is
being moved out of a stack, change the focus from the stack to the
window.

`refresh_focus_stack()` doesn't seem to be called here, but for good
measure, make sure that calling that function also won't remove a
`CosmicMapped` from the focus stack if it is currently part of a move
grab for the seat.
2025-11-04 15:41:08 -08:00
Ian Douglas Scott
e09fcec9f3 Use keyboard focus target rather than focus_stack in keybindings
`Action::Close` already used the keyboard focus target, but some other
bindings didn't. Presumably it's most intuitive if all "current window"
key bindings affect the window with keyboard focus.

These used the focus stack on the `focused_output()` (the one with
keyboard focus), so I guess the main impact is when the keyboard target
is a window being dragged? Then the binding will operate on that window,
or have no effect.

This seems related to some of the behaviors discussed in
https://github.com/pop-os/cosmic-comp/issues/453.
2025-11-04 15:41:08 -08:00
Ian Douglas Scott
12857672f6 Use shift_remove() instead of retain() in unmap_element() 2025-11-04 15:41:08 -08:00
Ian Douglas Scott
f230a23bd0 focus-stack: Use IndexSet::shift_remove() for remove
This seems like the correct way to use an `IndexSet`. It shouldn't be
possible to have multiple entries that match, since it's a "set".

We can't define `Borrow<CosmicMapped> for FocusTarget`, so the blanket
impl of `indexmap::Equivalent` won't work, but implementing seems fine.
2025-11-04 15:41:08 -08:00
Ian Douglas Scott
505e36dcda Make CosmicWindowInternal/CosmicStackInternal not Clone
`IcedElement` uses `Arc` internally (and compares with `Arc::ptr_eq`).
So these structs are never cloned, and probably shouldn't be.
2025-11-04 15:41:08 -08:00
Hosted Weblate
6e4164643e i18n: translation updates from weblate
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Torsten <keulehoschi@gmail.com>
Co-authored-by: Yelysei <yelysei.matviienko@proton.me>
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-comp/de/
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-comp/uk/
Translation: Pop OS/COSMIC Comp
2025-10-31 16:14:45 +01:00
Hosted Weblate
3084d4f605 i18n: translation updates from weblate
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Torsten <keulehoschi@gmail.com>
Co-authored-by: Yelysei <yelysei.matviienko@proton.me>
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-comp/de/
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-comp/uk/
Translation: Pop OS/COSMIC Comp
2025-10-31 13:23:59 +01:00
Ian Douglas Scott
e814eebcc0 Add ext-data-control-v1 protocol
This is identical to the wlr protocol, and Smithay has implementations
for both.

New clients should use the `ext` protocol where present. Not sure how
widely used it is yet, but we probably should have both for now.
2025-10-30 00:45:13 +01:00
Ian Douglas Scott
d2d7c655ac Expose wlr-data-control-unstable-v1 to non-sandboxed clients
Some users have complained about not supporting clipboard managers. But
this was possible, but hidden under the `COSMIC_DATA_CONTROL_ENABLED`
env var.

Since the security context protocol exists now to provide a way to not
expose a protocol like this to sandboxed clients, it should be safe to
expose this now.
2025-10-30 00:45:13 +01:00
Ian Douglas Scott
f82db23f4a Restrict atspi protocol to only clients without security context
This is only intended to be used by `orca`.

I guess `|_| true` was a placeholder for a potentially more restrictive
check, but use this for now, anyway.
2025-10-30 00:45:13 +01:00
Ian Douglas Scott
f91115fb45 Replace privileged field with a not_sandboxed() method
`privileged` now only indicates if a client is "sandboxed", i.e. it has
a security context, where the sandbox engine isn't cosmic-panel.

So replace the field with a method that's a bit more descriptive.
2025-10-30 00:45:13 +01:00
Ian Douglas Scott
1bea97d42a Don't check for privileged for creator of security context
This is redundant since unprivileged clients can't create security
contexts.

If we expose this protocol, trust `sandbox_engine`, etc. to be correct.
2025-10-30 00:45:13 +01:00
Ian Douglas Scott
5c40d8b035 Remove COSMIC_ENABLE_WAYLAND_SECURITY env var
Do not attempt to secure protocols from non-sandboxed clients.
2025-10-30 00:45:13 +01:00
Ian Douglas Scott
b25b3041cd session: Remove NewPrivilegedClient command
https://github.com/pop-os/cosmic-session/pull/154 removes the use of
this command.
2025-10-30 00:45:13 +01:00
Hosted Weblate
0816b870fe i18n: translation updates from weblate
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Sachin Chaudhary <chaudharysachinasachin@gmail.com>
Co-authored-by: lorduskordus <lorduskordus@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-comp/cs/
Translation: Pop OS/COSMIC Comp
2025-10-29 12:15:16 +01:00
Yureka
ab509dd88e Add example for customized window decorations
Signed-off-by: Yureka <yuka@yuka.dev>
2025-10-29 11:27:14 +01:00
Yureka
a74b6e3a9b Add hooks for custom window decorations
This is a first use of the new hooks system, which allows customizing
cosmic-comp at compile-time.
In this case, the view() function of CosmicWindow / CosmicStack is
hooked and the hook can change what is rendered as the header bar.

Signed-off-by: Yureka <yuka@yuka.dev>
2025-10-29 11:27:14 +01:00
Yureka
d6e11de1f1 expose cosmic_comp as a library
Allows other programs to depend on the cosmic_comp library crate and
start a cosmic-comp in their process by calling `cosmic_comp::run()`.
Later, customization parameters can be added to `run()`.
Note that the interface of the cosmic_comp library crate is not stable
in any way and might change anytime.

Signed-off-by: Yureka <yuka@yuka.dev>
2025-10-29 11:27:14 +01:00
Vukašin Vojinović
5a2eca29c3 chore: unused dependencies
Removes `bytemuck` and `smallvec`.
2025-10-22 23:55:11 +02:00
Vukašin Vojinović
586a16f17f chore: update CI 2025-10-22 23:55:11 +02:00
Vukašin Vojinović
1f7f0c70b7 chore: format for Rust 2024 2025-10-22 23:55:11 +02:00
Vukašin Vojinović
0a8da05847 fix(kms): early exit when iterating over crts
Clippy noted that this loop doesn't actually loop, so maybe this fixes some issues.
2025-10-22 23:55:11 +02:00
Vukašin Vojinović
b6c5d00bec cargo fmt 2025-10-22 23:55:11 +02:00
Vukašin Vojinović
5e9ea93819 chore: manual clippy 2025-10-22 23:55:11 +02:00
Vukašin Vojinović
0847247c33 chore: clippy 2025-10-22 23:55:11 +02:00
Vukašin Vojinović
3b70bc0265 chore: update dependencies 2025-10-22 23:55:11 +02:00