Commit graph

1005 commits

Author SHA1 Message Date
julianbraha
06d25df4ef Iterate over the array instead of an unnecessary vector 2024-08-29 16:39:39 +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
536484e9da screencopy: Use buffer age of 0 for render to temporary buffer
It seems we allocate a new `GlesRenderbuffer` every time we screencopy
to an shm buffer.

We probably should use a more complicated approach to do proper damage
tracking without any unnecessary copies, and re-using the GPU buffer,
but as long as this allocates a buffer the age of that buffer should be
treated as `0`.

Fixes corruption in cosmic-workspaces when shm screencopy is used. (For
instance, when Cosmic is run with software rendering.)
2024-08-27 23:28:13 +02:00
BrunoWallner
8114116e04 fixed animation issue completely for keyboard navigation and partially for touchpad gestures 2024-08-26 14:26:57 +02:00
João Capucho
66695482d0 Don't pass pointer button events to client when moving or resizing 2024-08-23 17:18:39 +02:00
João Capucho
3c24934f48 Track if a move or resize request is client initiated 2024-08-23 17:18:39 +02:00
Ian Douglas Scott
3625454420 Use monotonic time instead of 0 for motion events
Update to https://github.com/Smithay/smithay/pull/1509, and adopt a
similar change.
2024-08-22 07:22:44 -06:00
Ian Douglas Scott
ca6f05c585 Update pointer focus before motion occurs
If the surface under the pointer has changed, we should send an `enter`
event immediately, instead of waiting for the next motion event. This
seems to fix that, without producing unnecessary events.

Instead of `time: 0`, this and other synthesized events should probably
use `CLOCK_MONOTONIC`. It seems libinput does document that it uses
that.
2024-08-21 13:36:58 -06:00
Ian Douglas Scott
889499b64d Add single-pixel-buffer-v1 2024-08-21 09:26:13 -06:00
Ian Douglas Scott
c48dc1107f Update smithay and smithay-egui 2024-08-21 09:26:13 -06:00
Ian Douglas Scott
e119f10cdc toplevel-management: Set active output if changed, and move cursor
Previously, alt-tab wouldn't actually focus a window if it was on
another output, since the active output/workspace was unchanged.

We need to move the cursor if we activate a window on another output.
2024-08-21 05:10:51 -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
Richard Weber
bad8837d19 Add wl-clipboard to tiling exceptions 2024-08-14 11:05:58 -06:00
Victoria Brekenfeld
7660f7aaa9 focus: Don't swap focus from maximized tiled windows 2024-08-08 21:26:30 +02:00
Victoria Brekenfeld
f9d39144ed focus: Check target for fullscreen instead of workspace 2024-08-08 21:26:30 +02:00
Victoria Brekenfeld
e5a7dfbdb0 layout/tiling: enumerate all children before swapping 2024-08-08 21:26:30 +02:00
Victoria Brekenfeld
450cc6a323 layout/tiling: Make swapping layout less confusing 2024-08-08 21:26:30 +02:00
Victoria Brekenfeld
1f8915f802 layout/tiling: Don't unmap before moving children 2024-08-08 21:26:30 +02:00
Victoria Brekenfeld
3eb002c3f1 state: Also set primary_output/preferred_scale for lock/cursor-surfaces 2024-08-08 21:26:30 +02:00
Victoria Brekenfeld
10d45f7134 iced: Set default font 2024-08-08 16:44:27 +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
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
dc3dbfdba0 chore: Remove unused method 2024-08-02 20:54:15 +02:00
Victoria Brekenfeld
c3524d3546 stack: Fix round corners on maximize 2024-08-02 20:54:15 +02:00
Victoria Brekenfeld
5aaac707f8 window: Fix round corners on maximize 2024-08-02 20:54:15 +02:00
Victoria Brekenfeld
c299748997 config: Load toolkit config on start 2024-08-02 20:54:15 +02:00
Ashley Wulber
b8eaf5dcb4 chore: update smithay 2024-08-02 15:54:05 +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
Daniel
e01a55aae7
input: resize on Super + Right-Click Drag 2024-08-01 19:50:28 +02:00
Ian Douglas Scott
c1bf410466 toplevel-info: Fix race between binding wl_ouput and output_enter
This fixes an issue with `cosmic-panel` where, when a workspace is moved
back to an output after a monitor is disconnected and reconnected, the
panel doesn't hide because `cosmic-panel` thinks no toplevel is open on
that monitor.

After some testing, it seems `output_enter` isn't being sent here. In
particular, the `output_leave` call happens before the client binds the
`wl_output`, so there is no `wl_output` to send in an event yet.

This is addressed by keeping track of a set of `wl_output`s that we have
sent the event to. So if an output is bound, `refresh` can add it to
this list and send the event.

This is not needed for workspaces (though it could be done similarly)
since the handle objects are created by server events. So no race should
occur as long as the workspaces global is bound before the toplevel info
one.
2024-08-01 16:35:26 +02:00
Victoria Brekenfeld
607bd71aeb kms: Try to calculate dpi and scale factor 2024-07-31 13:02:08 +02:00
Victoria Brekenfeld
af553a16a6 input: Send modifiers of modifier-only bindings to clients 2024-07-29 23:33:55 +02:00
Victoria Brekenfeld
6c517bd8de input: Also focus a window on click, if the super key is held 2024-07-29 21:52:19 +02:00
Ian Douglas Scott
de264e250f Fix build with debug feature 2024-07-29 14:49:44 +02:00
Ian Douglas Scott
0e78104477 Fix build with profile-with-tracy feature 2024-07-29 14:49:44 +02:00
Victoria Brekenfeld
fdde46febd config: watch CosmicTk 2024-07-26 16:40:28 +02:00
Victoria Brekenfeld
61f11d1363 element/stack: Style fixes 2024-07-26 14:59:11 +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
Dominic Gerhauser
3214ef0250 element/window: Add maximize on header double-click 2024-07-26 13:22:56 +02:00
Victoria Brekenfeld
9239584435 chore: libcosmic update 2024-07-26 13:22:56 +02:00
Ian Douglas Scott
2a4bbf4238 Update zbus and i18n-embed-fl dependencies 2024-07-25 22:54:53 +02:00
Ashley Wulber
4f043133bc fix: intercept modifiere press for shortcut with no key 2024-07-23 16:12:31 +02:00
Ashley Wulber
f406bf33ae fix: only suppress keys when an action is on press
Actions which are on releasedon't have anything to suppress, and end up suppressing the next release.
2024-07-23 16:12:31 +02:00
Dominic Gerhauser
27f048b998 respect cosmic-tk setting for minimize and maximize 2024-07-22 19:08:19 +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
Victoria Brekenfeld
0a97147e45 input: Don't intercept disabled actions 2024-07-17 21:08:40 +02:00