Watch
1
0
Fork
You've already forked smithay
0
Commit graph smithay/examples
Author SHA1 Message Date
Ian Douglas Scott
f949fa4865 winit: Update winit to 0.31.0-beta.2 2026-06-11 10:43:32 -07:00
Ian Douglas Scott
0d14cd655f Add Dispatch2 and GlobalDispatch2, replacing delegate macros
A single `delegate_dispatch2!` replaces all other delegate macros.

When wayland-rs updates the definition of `Dispatch`, this macro will be
unnecessary, and `Dispatch` type bounds should become inferable by the
type system.

`Dispatch` is now implemented for the user-data type, so `smithay` is
able to provide blanket implementations as long as the user data is a
type owned by `smithay`. Therefore, `GlobalData` replaces `()` as a user
data (`smithay-client-toolkit` already did this), and udata that is
simply a type like `Weak<WlSurface>` is wrapped.
2026-04-30 16:13:15 +02:00
Ian Douglas Scott
0ebbbe9587 Run cargo +nightly fmt --all 2026-04-09 12:54:11 +02:00
Ian Douglas Scott
ddc4c1267f Use 2024 Rust edition
`smithay` already requires Rust 1.85.0, the version that introduces the
2024 edition. Updating to the new edition allows us to use if let
chains, etc.

To keep things simple here, this allows `unsafe_op_in_unsafe_fn` for
now, which is a warning by default in the 2024 edition.

Removing `ref` in various places is simple enough. The more complicated
issue here is "precise capture lists" using `use<..>`. This needs to be
manually added in various places for the API to still work as it does.

We also annoyingly need to turn some impl-trait arguments to explicitly
named type parameters:
https://doc.rust-lang.org/edition-guide/rust-2024/rpit-lifetime-capture.html#migrating-cases-involving-apit
2026-04-09 12:54:11 +02:00
ShootingStarDragons
3c56055d39 fix: typos
use typos to find all typos and fix it
and add typos.toml for lib nix
2026-02-12 12:48:05 +01:00
Victoria Brekenfeld
c376ab0462 input/dnd: Compile without wayland_frontend 2025-11-25 13:18:22 +01:00
Kirill Chibisov
c03c373e35 Reapply "selection: instantly notify clients when source dies"
With the fixes and adjustments that were missed during the review.
The new protocol errors were also relaxed to follow `wlroots` at this
time, since firefox does violate protocol a bit and thus crashing it
is not a great thing to do.

This reverts commit d34af7bfe0.
2025-07-22 12:30:49 +02:00
Victoria Brekenfeld
d34af7bfe0 Revert "selection: instantly notify clients when source dies"
This reverts commit 62454ebe8c.
2025-07-15 18:27:32 +02:00
Kirill Chibisov
62454ebe8c selection: instantly notify clients when source dies
Smithay uses lazy notify when there's actual interaction, which is
unexpected and doesn't properly reflect the state of the clipboard to
clipboard managers. Instead immediately notify clients when the source
was destroyed by sending `null`.

Links: https://github.com/YaLTeR/niri/issues/1831
2025-07-15 16:09:51 +02:00
Victoria Brekenfeld
df08c6f29e renderer: Introduce explicit framebuffers 2025-03-02 20:33:19 +01:00
Ian Douglas Scott
25fe5ffe39 utils/geometry: Deprecate ::from_loc_and_size in favor of a ::new
This new function is the same as `from_loc_and_size`, except it takes
concrete types as arguments instead of `impl Into`.

This matches `euclid::Rect`'s API, but it also seems a little better to
have strong typing without implicit conversion like this. In a few cases
it's not obvious that the argument is variable of tuple type, so there
is an implied assertion that the coordinate space is right.

The use of `#[deprecated]` makes this not entirely urgent for
compositors, but uses of this should be updated to `::new`, or other
functions like `from_size`.
2025-01-02 20:29:54 +01:00
Ian Douglas Scott
7279814f8d Use Rectangle::from_size and ::zero where possible
A couple patterns are used for this already. This method makes it
consistent and a bit more concise.

This seems to cover a lot of the uses of `Rectangle::from_loc_and_size`.
2025-01-02 20:29:54 +01:00
Victoria Brekenfeld
dbe96e2037 msrv: Bump to 1.80.1 2025-01-02 13:06:26 +01:00
Ian Douglas Scott
566e176b44 Use Keycode type consistently for representing keycode
It seems good to use a dedicated type for keycodes, particularly given
there's two conventions for keycodes, offset by 8. So there's ambiguity
about what the numberic value of the keycode actually represents.

We might prefer to use the Wayland value rather than the X11 version
like `xkeysym::KeyCode` uses. But it would complicate things to have two
different keycode types, and the code that calls `kbd.key` already is
converting from `Keycode`.
2024-09-18 13:02:57 +02:00
Victoria Brekenfeld
9a7afcf7b1 wayland: Use new client_scale and Client-space in various protocols 2024-08-29 19:53:27 +02:00
Christian Meissl
801d90a144 renderer: introduce Color32F
this replaces all occurrences of [f32; 4] with an explicit
color type
2024-08-20 10:47:03 -06:00
Victoria Brekenfeld
c4ec3fa75f compositor: Make cached_state access thread-safe 2024-06-21 16:26:59 +02:00
Christian Meissl
26af6a4921 renderer: use the new FormatSet to keep formats in order 2024-06-20 22:40:21 +02:00
Christian Meissl
1859d4d28e renderer: forward element opaque regions
this allows to optimize drawing textures in a renderer
2024-06-11 19:48:15 +02:00
Victoria Brekenfeld
54208d54f6 egl: Propagate sync interrupt where possible 2024-04-06 17:25:26 +02:00
Christian Meissl
dc43fbd60a input: add infrastucture for proper touch support
this brings touch handling to the same level as we
already provide for pointer and keyboard.
2024-02-23 22:50:08 +01:00
Victoria Brekenfeld
0004846979 egl: Fix multiple references to same EGLDisplay 2024-01-24 15:12:31 +01:00
Christian Meissl
586565ae7d backend: introduce DumbAllocator
this allows to create a dumb buffer allocator
from an open drm device fd.
2024-01-05 17:06:34 +01:00
Christian Duerr
4f7dbda923
Fix tests 2023-11-01 19:21:55 +01:00
Kirill Chibisov
86de9aeee3
Update winit to 0.29.2
Make better winit integration by providing a calloop's WaylandSource
for it. The winit backend now doesn't use vsync and utilizes frame
callbacks, when the user cooperates and asks for `redraw_requested`.

Fixes #146.
2023-10-24 16:06:02 +04:00
Kirill Chibisov
8e779d02a3
wayland: add wlr-data-control protocol
wlr_data_control is a protocol used to implement clipboard managers or
access clipboard without creating a window. The implementation of it
ties to regular selections, thus the selection handling was unified
to reduce the maintainance burden.

The present selection modules, like `walyand/primary_selection` and
`wayland/data_device` moved into the new `wayland/selection` module.
Keeping their original implementation, where it was possible.

The new selection module uses the common structure of `seat_data`,
`device`, `source`, and `mod.rs` used in the said above modules, however
it uses the hand-rolled dynamic dispatch with the `selection_dispatch!`
macro. The offers and selection replies are all handled together,
so the code is unique in the most cases.

As a side effect of the selection update and merging the handling of
the primary and clipboard selection into the single `SelectionHandler`
trait (users could still just use one of them, it's not a must to have
both), the xwayland was changed to use some types from the
`wayland/selection` module.
2023-10-02 15:55:00 +04:00
Elinor Berger
eb44d1721e clippy fixes 2023-09-25 19:03:55 +02:00
Christian Meissl
dca20098c5 renderer: allow to specify a kind for an element
this can give the backend a hint about how to handle
the element.
for now the only supported use-case is to not accidentally
assign non cursor content to the cursor plane
2023-09-09 19:31:22 +02:00
Ian Douglas Scott
b78131c366 buffer-test: Open device with write permission
Without this, I see `gbm_create_device` cause a segfault within the
Intel driver.
2023-08-10 12:28:17 -07:00
Christian Meissl
60bcba03a5 renderer: replace glFinish with SynPoint 2023-06-27 18:26:10 +02:00
Victoria Brekenfeld
2e42a2a052 wayland: Add user_data to data_device/primary server-side selections 2023-05-23 19:15:32 +02:00
Victoria Brekenfeld
eadd43dd85 elements: Allow alpha to be specified in AsRenderElements 2023-05-11 17:59:59 +02:00
Victoria Brekenfeld
d5bacc6e7d compositor: Use the TransactionQueue 2023-05-09 12:01:34 +02:00
Poly
581ece1f7a wayland.compositor: Pass state to the destruction hook 2023-05-05 19:02:17 +02:00
Poly
7b86bccb94 Update minimal example 2023-05-05 01:14:45 +02:00
Victoria Brekenfeld
b1549d3a37
Merge pull request #989 from wash2/selection-seat
feat: pass seat to all ServerDndGrabHandler methods and also to DataDeviceHandler::send_selection
2023-04-12 13:04:23 +02:00
Ashley Wulber
90d6917679
feat: pass seat to all ServerDndGrabHandler methods and also to DataDeviceHandler::send_selection 2023-04-11 17:44:43 -04:00
Victoria Brekenfeld
b1d4994d12 renderer: Allow downloading in all compatible formats 2023-04-11 21:02:02 +02:00
Victoria Brekenfeld
594fb497ef refactor: Rename Gles2 -> Gles 2023-04-11 21:02:02 +02:00
Victoria Brekenfeld
7196c3e0ae renderer: Format selection for memory formats 2023-04-11 21:02:02 +02:00
Poly
681114d4e3 Split event source out of DrmDevice 2023-02-24 18:01:32 +01:00
Christian Meissl
5aba2ab8a9
feat: switch from slog to tracing
Switch from slog to tracing
---------

Co-authored-by: Victoria Brekenfeld <github@drakulix.de>
2023-02-22 18:41:12 +01:00
Victoria Brekenfeld
5d8a5ca3c4 buffer_test: Filter vulkan devices 2023-02-10 21:00:07 +01:00
Victoria Brekenfeld
228ea71fef allocator/dmabuf: Add DmabufAllocator wrapper 2023-02-10 21:00:07 +01:00
Victoria Brekenfeld
d2b7e33af4 examples: Buffer import tester 2023-02-08 15:18:45 +01:00
Victoria Brekenfeld
a4b836f9f0
Merge pull request #816 from Smithay/feature/gat_renderer 2022-11-23 23:39:48 +01:00
Ian Douglas Scott
8eceeb8067 Remove io-lifetimes dependency
Since Smithay now requires Rust 1.65.0, and io-lifetimes reexports these
types from std on recent Rust versions, this dependency is redundant.
2022-11-17 11:17:39 -08:00
Victoria Brekenfeld
d2f406c284 anvil/smallvil/examples: New renderer api 2022-11-17 18:03:53 +01:00
Victoria Brekenfeld
f300461ec6 winit: Support using the glow-renderer 2022-11-12 21:26:47 +01:00
Christian Meissl
eabe0d56e6 fix weston-terminal on minimal example 2022-10-11 17:58:08 +02:00