Commit graph

166 commits

Author SHA1 Message Date
Ian Douglas Scott
2fe5897db0 Replace screencopy with ext-image-copy-capture-v1 2025-04-01 18:22:42 +02:00
Victoria Brekenfeld
babb96ddfa a11y/zoom: Drop last state 2025-03-28 18:35:06 +01:00
Victoria Brekenfeld
7373b3f513 backend: Support screen filters in nested mode 2025-03-24 19:10:52 +01:00
Victoria Brekenfeld
7929e25966 kms: Support screen filters 2025-03-24 19:10:52 +01:00
Victoria Brekenfeld
ea09334ff7 config: Add screen-filter configuration and persistent state 2025-03-24 19:10:52 +01:00
Ian Douglas Scott
7340e2beff Improve handling of XDG activation tokens in shell
Requires https://github.com/Smithay/smithay/pull/1676.

This changes two things:
* `Workspace::is_empty` no longer checks if there are activation tokens,
  but a separate `Workspace::can_auto_remove` checks if the workspace is
  empty and has no activation tokens.
  - When we add workspace pinning, that can also be checked there.
* `Workspace` no longer contains a `pending_tokens` list that is updated
  on `refresh`. Instead, `can_auto_remove` takes the xdg activation
  state as an argument.

Since `Workspace::refresh` normally is run for focused workspaces, this
fixes allowing non-focused workspaces to be removed when an activation
token expires. It seems generally good to avoid tracking the activation
tokens in two places, and this is probably more efficient than needing
to refresh in more places.

By splitting this, we still don't remove an empty workspace if it has a
pending activation token, but we also don't add an empty workspace for
an activation token.

This mitigates the confusing behavior with activation tokens that aren't
used, but having to wait a few seconds in some cases before a workspace
is removed is still a little confusing. (We probably want `cosmic-term`
and `cosmic-workspace` to either consume the activation tokens they are
passed, or not be passed tokens when started by keybinding?)

Fixes https://github.com/pop-os/cosmic-comp/issues/1099.
2025-03-14 17:53:34 +01:00
Victoria Brekenfeld
01bc39dade main: throttle refresh 2025-03-06 21:28:52 +01:00
Victoria Brekenfeld
c45a58c16c wayland: Implement cosmic-a11y-v1 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
b92879e60b zoom: Fix config/state changes 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
db13eea91c shell: Allow active workspace to be None 2025-01-06 20:23:05 +01:00
Victoria Brekenfeld
6be5009b37 kms: Allow diverging primary plane formats under certain conditions 2025-01-06 20:23:05 +01:00
Victoria Brekenfeld
8b87d6524e kms: Use new DrmOutput api 2025-01-06 20:23:05 +01:00
Ian Douglas Scott
1118aa2877 When removing output global, use disable_global, remove with timer
This should fix an issue where output hotplug can sometimes cause
clients (including XWayland) to crash with a protocol error trying to
bind the output.

Using a timer doesn't seem ideal, but seems to be the correct way to do
this at present. Wlroots `wlr_global_destroy_safe` is basically the same
as this.

Adding a `LoopHandle` argument to `OutputConfigurationState::new` seems
awkward, but maybe better than a handler method for removing globals.
(`IdleNotifierState::new` also takes a `LoopHandle`). Perhaps Smithay
could provide some kind of helper for this.
2024-12-19 00:17:38 +01:00
Ashley Wulber
60558e18fd overlay-notify: Implement handler 2024-11-27 13:20:18 +01:00
Alyssa Ross
7e8cb91d23 Unthrottle windows in screencopy sessions
If an individual window was being screencast, and that window was not
visible, for example because it was minimized, that window would only
be rendered every 995ms, which did not look good on the screencast.

Now, non-visible windows with active screencopy sessions, as well as
windows that are mapped on non-visible workspaces with active
screencopy sessions, are rendered every 1/60th of a second, which
matches the frame rate of the video produced by
xdg-desktop-portal-cosmic.  In future, it might be good to let
screencopy clients suggest a redraw rate for captured windows.
2024-11-18 18:25:57 +01:00
Ian Douglas Scott
4db2e3ec25 Use new primary scanout output if old output is disabled
`Output` in Smithay doesn't track if the output still exists, other than
based on whether or not it has strong references. Which doesn't seem to
be working correctly.

There may be leaked strong references to `Output`s somewhere, and maybe
Smithay should track if an output is still valid, generally when it is
exposed as a Wayland global
(https://github.com/Smithay/smithay/issues/1584). But a check like this
works for now.

Addresses https://github.com/pop-os/cosmic-comp/issues/985.
2024-11-13 23:34:30 +01:00
Ian Douglas Scott
91bc1c00bf Recalculate tiling layout on change of display configuration
Previously, changing the resolution, scale, or orientation of a display
left tiling layouts that don't fill the screen and/or extend off of the
screen area, until an action like opening a window makes it recalculate
window positions.

Now this is done immediately when the output configuration changes.

Perhaps we should consider if we want a different animation for things
like rotating a screen, but the current behavior isn't too bad.

For floating layouts, `refresh` already remaps windows that are out of
bounds for the output, so this doesn't change that. Perhaps decreasing
the resolution (or moving to a lower resolution output) should try to
reduce the window size. But the current behavior generally seems okay.
2024-11-12 11:21:42 +01:00
Ian Douglas Scott
90883c6ab1 Add cosmic_atspi_v1 protocol
Used to provide a backend for `AtspiDevice` in `at-spi2-core`, so Orca
keybindings can work.
2024-10-31 18:49:56 +01:00
Ian Douglas Scott
ea27ec5e28 DPMS with wlr-output-power-management-unstable-v1 protocol 2024-10-25 10:31:24 +02:00
Ian Douglas Scott
087be20365 Add util function for boolean env vars
It's probably good to be consistent about what is recognized as "true"
without copying the same code.
2024-10-15 11:45:46 +02:00
Ian Douglas Scott
15a6425836
Set default output transform based on DRM panel orientation (#901) 2024-10-07 18:12:40 +02:00
Victoria Brekenfeld
9c7c41c508 toplevel-info/mgmt: Update to v2/v3 2024-09-23 10:55:00 +02:00
may
0ffe6ae718
wayland: Implement cursor-shape-v1 2024-09-09 16:21:27 +02:00
skewballfox
7da0bc430a added cursor_follows_focus and focus_follows_cursor 2024-09-04 20:22:40 +02:00
Victoria Brekenfeld
971c28db38 xwayland: Add descaling option 2024-09-02 18:58:13 +02:00
Ian Douglas Scott
ed64e26faf Add xdg-foreign-unstable-v2 protocol 2024-08-30 13:08:08 +02:00
Ian Douglas Scott
1342c000ab Add ext-foreign-toplevel-list-v1 protocol 2024-08-29 17:04:12 +02:00
Ian Douglas Scott
889499b64d Add single-pixel-buffer-v1 2024-08-21 09:26:13 -06:00
Victoria Brekenfeld
3eb002c3f1 state: Also set primary_output/preferred_scale for lock/cursor-surfaces 2024-08-08 21:26:30 +02:00
Ian Douglas Scott
5537fa4822 Use EGL_MESA_device_software as fallback for screen capture
Previously, screenshots and screencopy panicked if no DRM render nodes
are present.

Instead, create a `GlowRenderer` using llvmpipe, if available. This
should work as a fallback until pixman is integrated.
2024-08-07 10:49:39 -07:00
Ian Douglas Scott
87020c79ba Define a RendererRef enum, referencing multi or glow renderer
Avoids a little duplication (matching two variants, instead of three
backends).

The behavior, including errors and panics, should be unchanged for now.
Performance should also not be impacted.

This should help for adding llvmpipe rendering without a device node on
the kms backend, or for adding a variant for pixman.
2024-08-07 10:49:39 -07:00
Michael Aaron Murphy
553c49b42b feat: runtime configurable keybindings 2024-07-01 15:20:23 +02:00
Victoria Brekenfeld
26ccb653b7 output: Store position as u32 and offset bad configs 2024-06-27 12:34:51 +02:00
Victoria Brekenfeld
eea93d543e state: Correctly update primary output 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
12fab6e220 kms: Don't block surface-threads on startup cond 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
31ff17a323 kms: Limit frame-callbacks to one per refresh 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
92f3dbce01 chore: Cleanup 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
cc0bbb61e3 debug: Drop FPS struct for kms timings 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
469a366207 kms: New backend
New backend utilizing a thread per surface for precise frame
scheduling.
2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
3b7bba3add debug: Drop puffin, interactivity, renderdoc 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
9e05a84db2 state: Split up send_frames 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
f481112cf9 output-configuration: Test all outputs at once 2024-06-26 12:59:33 +02:00
Ian Douglas Scott
036ca84829 Add alpha-modifier-v1 protocol 2024-06-10 14:31:51 +02:00
Ian Douglas Scott
4f076e0753 Update smithay, with xwayland shell, Cow, etc. 2024-05-21 19:31:50 +02:00
Ian Douglas Scott
47f8c1da38 Define a advertised_node_for_client instead of duplicating code
Can't use this in `SecurityContextHandler` since it only has a `ClientId`,
not a `Client`.
2024-05-15 13:12:24 +02:00
Ian Douglas Scott
73b12194c0 Update smithay 2024-05-10 13:51:28 +02:00
Ian Douglas Scott
a9740e5040 Change how COSMIC_ENABLE_WAYLAND_SECURITY/privileged is handled
Manually starting `cosmic-panel` was not working properly in release
builds, because without `cfg!(debug_assertions)`, the `privileged` flag
wasn't sent on the panel, so it couldn't be propagated to the applets,
which also fail the `client_has_no_security_context()` check.

I don't see a way to have both the `cfg!(debug_assertions)` check and
`COSMIC_ENABLE_WAYLAND_SECURITY`. Now only the latter is used, and it
determines the value of `privileged` for clients started normally. In
the future, we could make the default value of
`COSMIC_ENABLE_WAYLAND_SECURITY` depend on `cfg!(debug_assertions)` if
desired.

This also corrects the inconsistency that the `cfg!(debug_assertions)`
check wasn't applied to the render-node-specific Wayland sockets.
2024-05-08 13:10:07 +02:00
Victoria Brekenfeld
5f4377bf59 wayland: Add cosmic-output-management 2024-05-07 12:25:15 +02:00
Victoria Brekenfeld
98ec82db77 output-configuration: Add vrr state 2024-05-07 12:25:15 +02:00
Mattias Eriksson
19ba568f02 Initial support for idle notify and idle ihibit 2024-05-03 14:38:58 +02:00