Commit graph

308 commits

Author SHA1 Message Date
Victoria Brekenfeld
dbb51e827d kms: Fix enabling outputs 2024-11-27 09:37:01 +01:00
Ian Douglas Scott
61692b21ad Run cargo format 2024-11-18 18:24:53 +01:00
Ashley Wulber
8d5541b27f fix: apply transform to damage before blitting 2024-11-13 16:33:43 +01:00
Victoria Brekenfeld
5207453157 kms: Don't substract for mirrored outputs 2024-10-25 10:42:38 +02:00
Ian Douglas Scott
ea27ec5e28 DPMS with wlr-output-power-management-unstable-v1 protocol 2024-10-25 10:31:24 +02:00
Victoria Brekenfeld
51c8588f89 render: Use render_input_order 2024-10-22 19:43:47 +02:00
Ian Douglas Scott
b8c429facb Add COSMIC_DISABLE_DIRECT_SCANOUT env var
Like `anvil`. Useful for testing and working around issues.
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
Ian Douglas Scott
a96394f7a6 Update egui, smithay-egui, smithay 2024-10-02 23:55:10 +02:00
Christian Meissl
afdb656778 dnd: correct handling of cursor buffer offset 2024-09-23 11:13:21 +02:00
Ian Douglas Scott
d7ca0324c5 Remove needs_key_repetition argument
Not supressing key repetition in backends seems like it was a bug, and
should be fixed as of https://github.com/Smithay/smithay/pull/1535.

So an argument for this should be unnecessary now.
2024-09-19 16:23:25 +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
julianbraha
52280e9823 Remove unnecessary casting 2024-09-03 16:08:17 +02:00
Victoria Brekenfeld
07f898590a kms: Fix rare mirroring crash 2024-09-02 20:44:23 +02:00
julianbraha
52ad30c264 Remove unnecessary lifetimes 2024-08-30 17:53:56 +02:00
julianbraha
2e2356ab5f Use map.entry().or_insert() instead of map.contains_key() and map.insert() 2024-08-29 16:39:39 +02:00
Ian Douglas Scott
c48dc1107f Update smithay and smithay-egui 2024-08-21 09:26:13 -06:00
Jeremy Soller
a3c81119e8 Use fallback scale if size is invalid 2024-08-16 06:59:51 -06:00
Victoria Brekenfeld
8d2cc05f03
kms: Try to calculate dpi and scale factor (Take 2)
Co-authored-by: Jeremy Soller <jackpot51@gmail.com>
2024-08-15 15:10:40 -06: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
Ian Douglas Scott
4748916ff9 Make RenderElement implementations generic to reduce duplication
It would make sense to have a bound like
`for<'frame> R::Frame<'frame>: AsGlowFrame<'frame>`. But that appears to
not behave properly due to current limitations of the borrow checker:
https://blog.rust-lang.org/2022/10/28/gats-stabilization.html#implied-static-requirement-from-higher-ranked-trait-bounds

Instead, this makes `glow_frame` and `glow_frame_mut` associated
functions of the `AsGlowRenderer` trait. Then it is pretty
straightforward to make the `RenderElement` implementations generic
using that and `FromGlesError`.

It would make sense to make `Self::Error: FromGlessError` a requirement
of the `AsGlowRenderer` trait, but due to the lack of implied bounds
support, that produces a bunch of errors about missing bounds. If Rustc
improves that eventually, some bounds could be cleaned up a bit:
https://github.com/rust-lang/rust/issues/44491
2024-08-05 12:58:52 +02:00
Victoria Brekenfeld
2cef99ae78 Revert "kms: Try to calculate dpi and scale factor"
This reverts commit 607bd71aeb.
2024-08-01 23:38:11 +02:00
Victoria Brekenfeld
607bd71aeb kms: Try to calculate dpi and scale factor 2024-07-31 13:02:08 +02:00
Ian Douglas Scott
0e78104477 Fix build with profile-with-tracy feature 2024-07-29 14:49:44 +02:00
Victoria Brekenfeld
8971d8f430 kms: Fix previous commit.. 2024-07-26 14:07:21 +02:00
Victoria Brekenfeld
64e03d11d7 kms: Fix potential panic when enumerating connectors 2024-07-26 14:00:16 +02:00
Victoria Brekenfeld
ec5d89eaa9 kms: Make sure edid model doesn't contain 0 byte 2024-07-18 17:31:57 +02:00
Victoria Brekenfeld
4a22724cb8 kms: HACK: avoid crashing on bad edids 2024-07-18 17:31:57 +02:00
Ian Douglas Scott
9c65476091 Set ElementFilter in render_output to match kms backend
This way the same behavior will apply in winit/x11 backends.
2024-07-15 17:12:05 +02:00
Ian Douglas Scott
0636bcdef3 Add workspace_overview_is_open function; put in a utils::quirks mod
This is increasingly not just related to screencopy, so it's weird to
add there. I don't see any other module that fits, so add one called
"quirks" (like the Linux kernel uses for device-specific handling in
generic drives).
2024-07-15 17:12:05 +02:00
Ian Douglas Scott
355b142c52 When cosmic-workspaces is shown, render only layer-shell surfaces
This allows `cosmic-workspaces` to rely on cosmic-comp for rendering the
background, and just have transparency. This should be a more reliable
and performant way of doing things, at least for now.

Instead of adding another opaque bool argument, this defines an
`ElementFilter` enum, which makes calls more readable.

Window surfaces are still included in screencopy, as needed for the
workspace previews.
2024-07-15 17:12:05 +02:00
Ian Douglas Scott
94fecec9cb Add a SplitRenderElements type, with useful methods
`(w_elements, p_elements)` tuples are used in a bunch of places. A
struct with named fields is generally an improvement just due to the
fact the order is non-obvious.

But we can also add methods. In particular,
`extend_from_workspace_elements` abstracts out some of the more
redundant code in `workspace_elements`.

It would be nice to avoid allocation everywhere, but iterators would
complicate lifetimes, run into issues with needing multiple mutable
borrows to things like the `Renderer`, and be awkward in certain
functions without generator syntax. In any case, cosmic-comp already
relies on allocating vectors here.

If this abstraction is commonly useful in compositors, perhaps it could
be moved to Smithay.
2024-07-15 17:12:05 +02:00
Victoria Brekenfeld
c506d94ac8 shell: Don't consider active overviews animations 2024-07-15 16:31:24 +02:00
Victoria Brekenfeld
2d0f1cbf2b chore: smithay update 2024-07-02 13:15:30 +02:00
Victoria Brekenfeld
06c12040f9 render: Fix grey screen on workspace switch 2024-06-28 12:31:50 +02:00
Victoria Brekenfeld
8da3ac6d75 kms: Fix frame scheduling 2024-06-27 18:15:18 +02:00
Victoria Brekenfeld
16691581ff render/cursor: Don't crash for themes with zero delay 2024-06-27 16:41:38 +02:00
Victoria Brekenfeld
26ccb653b7 output: Store position as u32 and offset bad configs 2024-06-27 12:34:51 +02:00
Victoria Brekenfeld
76fca0c591 chore: Fix smithay version 2024-06-26 16:18:08 +02:00
Victoria Brekenfeld
449048bdc5 kms: Fix unreachable code during forced queued redraws 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
707eace679 kms: Don't leak an EGLImage on every import 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
eea93d543e state: Correctly update primary output 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
ddcb435632 debug: Fix running with new kms backend 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
bfbf20d61d kms: fixup device-usage logic 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
a97279147e cursor: Re-enable cursor image cache 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
977ad674e5 kms: Fix initial output placement 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