Commit graph

895 commits

Author SHA1 Message Date
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
cf0b0f9d2d chore: Move some rendering-related state into the shell 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
cd90371c1e xwayland: Make client drm-node threadsafe 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
c7d50e7c5b seat: Make render-related state thread-safe 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
bd58481d19 element: Introduce CosmicMappedKey for safely hashing windows across threads 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
Victoria Brekenfeld
aae16c49dc screencopy: Make threadsafe 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
e78e199663 chore: Update smithay for thread-safety 2024-06-26 12:59:33 +02:00
Ian Douglas Scott
f2342f56c1 Update to latest Smithay version 2024-06-19 12:39:16 +02:00
Ian Douglas Scott
fb88f389c3 Fix scheduling render on initial window configure map
Not sure if there's a better way to organize this, but this makes sure
`visible_output_for_surface` can find an output and schedule a render,
on initial configure.

Fixes https://github.com/pop-os/cosmic-comp/issues/476.
2024-06-12 09:39:07 +02:00
Ian Douglas Scott
036ca84829 Add alpha-modifier-v1 protocol 2024-06-10 14:31:51 +02:00
Victoria Brekenfeld
b5dcec5215 focus: Don't stack overflow because None=None 2024-06-06 13:07:29 +02:00
Ian Douglas Scott
697ec9e1fe Use active() instead of surfaces().any in stack same_client_as
Setting the clipboard is only allowed when the keyboard focus is the
same client as the client trying to set the clipboard. We shouldn't
allow background windows in stacks to set the clipboard.

I don't know if anything else expects `same_client_as` to have this `any`
behavior.
2024-06-04 13:24:25 +02:00
Ian Douglas Scott
d9a1ec04bd Set clipboard/primary focus in refresh_focus
This should fix https://github.com/pop-os/cosmic-comp/issues/494, and
make clipboard and primary focus consistently correct.

Changing the active element of a stack needs to change the clipboard
focus, but it wasn't being changed since the `KeyboardFocusTarget` was
unchanged. The `CosmicStack` methods that change the active stack
element also have no obvious way to change the keyboard focus. So we can
set this in `refresh_focus`, which should be correct.

If the new focus `WlSurface` is `None`, this clears the focus instead of
leaving it as the previous code did. I believe that is desirable.

Requires https://github.com/Smithay/smithay/pull/1442 to avoid repeated
`offer`s, instead of only when focus changed.

(Perhaps this could better be solved by having a `WlSurface` variant of
`KeyboardFocusTarget`, like pointer focus, or some mechanism for a stack
of focus, which could help other things. But it's also unclear exactly
how that would work with the code for setting the active stack element,
among other questions.)
2024-06-04 13:24:25 +02:00
Ryan Brue
b4a712c2bf chore: cargo fmt 2024-05-30 23:05:34 +02:00
Ryan Brue
6ca1a37a53 design: Make server side decorations compact 2024-05-30 23:05:34 +02:00
Ashley Wulber
13e67f3dc2 fix: apply activated state when updating maximized layout 2024-05-30 22:25:33 +02:00
Ian Douglas Scott
0c54511477 Invert is_decorated test in min_size/max_size
It looks like these if conditions assumed `true` mean "has SSDs". But it
actually means the surface is client-side decorated.
2024-05-29 06:26:41 -06:00
Ian Douglas Scott
1ed9649891 Account for SSD_HEIGHT in XwaylandHandler::configure_request
`CosmicWindow::set_geometry` is going to subtract the `SSD_HEIGHT`
before setting the size for the X11 window, so we need to include it
here.
2024-05-29 06:26:41 -06:00
Ashley Wulber
a3df48fe17 fix: update maximized elements when refreshing the floating layout
fixes the gap between the window and the panel
2024-05-29 01:05:09 +02:00
LazyTanuki
dcc4873e60 feat: configurable keyboard repeat rate and delay 2024-05-23 22:41:54 +02:00
PixelDots
b3c606fdf6 Fixes https://github.com/pop-os/cosmic-epoch/issues/346 2024-05-23 17:17:37 +02:00
Ian Douglas Scott
4f076e0753 Update smithay, with xwayland shell, Cow, etc. 2024-05-21 19:31:50 +02:00
Ian Douglas Scott
dfb3bea595 Disable Smithay use_system_lib to use Rust backend to wayland-rs
It seems this was needed for `renderer.bind_wl_display`. But only in the
X11 and winit backends. Unless there's some less obvious reason to use
the `use_system_lib` feature, it seems undesirable and avoidable.

This uses `WlDrmState` to provide `wl_drm` on those backends instead.
2024-05-15 13:12:24 +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
46fd6ebd61 Fix tablet input
We need to call `add_tablet` for each tablet device, not just if the
capability is new. Also, the tool needs to be added with `add_tool`.

`xournalpp` seems to be working now.
2024-05-15 08:16:43 +02:00
Ian Douglas Scott
36bf611bac fix: Apply scroll_factor to v120 events
I wasn't sure if, or how, scaling should apply to the `scroll_value120`
events. But it seems both sway and kwin just multiply by the scale
factor then round, so that seems reasonable.

This seems to fix https://github.com/pop-os/cosmic-settings/issues/270.
2024-05-10 14:00:45 +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
954aa6edeb output-management: Handle destroy requests better 2024-05-07 12:25:15 +02:00
Victoria Brekenfeld
45bdffe802 output-management: Correctly advertise enabled-state for mirrored outputs 2024-05-07 12:25:15 +02:00
Victoria Brekenfeld
1048d99c05 output-management: Don't advertise wl_output for mirrored outptus 2024-05-07 12:25:15 +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
Victoria Brekenfeld
4b71674e10 output-configuration: Support release-requests / v3 2024-05-07 12:25:15 +02:00
Victoria Brekenfeld
3eb6c02008 kms: Output mirroring 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
Ian Douglas Scott
c4fc91d6e9 screencopy: Don't send fail after ready
Cosmic-workspaces was having an issue when the compositor sent `ready`,
`failed`, then `stopped`. This could be worked around client-side, but
presumably the compositor should never send more than one
`failed`/`ready` for a particular frame.

It seems cleaner to have `FrameInner::fail` as the only place that sends
`failed`. So any checks can be there. I believe the logic there should
be appropriate for every call.
2024-05-03 14:21:30 +02:00
Ian Douglas Scott
3697494146 screencopy: Fix reference cycle, that leaks buffer
Before this, `/proc/$(pidof cosmic-comp)/maps` quickly expands in length
when cosmic-workspaces is opened and closed a bunch of time, preventing
the GPU memory from being freed. Which on my Intel system can lead to
OOM eventually.

There may be other leaks to deal with, but `maps` no longer shows this
issue.
2024-04-30 13:05:16 +02:00
Ryan Brue
90227471bf feat: floating window tiling gaps 2024-04-22 10:44:14 +02:00
Ian Douglas Scott
8cee91c88f Support touch drag for SSD toplevels, and stacks
We already direct touch events to Iced, and the Cosmic `HeaderBar`
widget already recognizes drags from touch events. So it seems updating
`last_seat` is all that was needed for windows SSDs.

For stacks, the same works, plus moving using the same logic for
detecting drags that is used for mouse events.
2024-04-19 09:30:46 +02:00
Ian Douglas Scott
916b7729a5 fix: Add Element::kind method to CosmicElement
The default implementation always returned `Kind::Unspecified`. Instead,
we should pass this method through to the wrapped element.

This fixes the use of cursor planes. Now trace logs show Smithay
assigning an element to the cursor plane, and tools like `drm_info` show
the cursor plane with an `FB_ID` attached.
2024-04-17 12:01:25 +02:00
Ian Douglas Scott
17ddc7ce24 Update smithay
Updates for changes in https://github.com/Smithay/smithay/pull/1391.
2024-04-17 11:59:13 +02:00
Victoria Brekenfeld
5d5a510691 state: Move shell behind RwLock 2024-04-16 18:50:54 +02:00
Victoria Brekenfeld
647deb81f1 shell: Move seats into shell 2024-04-16 18:50:54 +02:00
Ian Douglas Scott
1216cd0b67 Add unset method to input grab traits
Fixes https://github.com/pop-os/cosmic-comp/issues/403.
2024-04-15 18:53:09 +02:00
Ian Douglas Scott
d16a9e387d Remove outdated TODO comment 2024-04-15 11:37:03 +02:00
Ian Douglas Scott
f2efc5d56f shell: Fix MoveGrab with touch not on output pointer is on 2024-04-15 11:37:03 +02:00