gioser

tawasuyu/mirada

Sovereign tiling Wayland compositor + window manager in Rust, on Llimphi.

⎇ main vendor/smithay/CHANGELOG.md Markdown · 510 siq'ikuna · 25.7 KB Ñawpa willay ch'uya

chore: refresco desde el monorepo (pin tawasuyu.git v0.2.0) a91da3fea · Sergio ·

1# Smithay Changelog
2
3## Unreleased
4
5## 0.7.0
6
7### Breaking changes
8`DrmSyncobjHandler::drm_syncobj_state` is now Optional.
9Whenever state is None `ImportTimeline` request will result in `InvalidTimeline` protocol error.
10This allows one to destroy DrmSyncobjState by calling `DrmSyncobjState::into_global()`
11```diff
12-fn DrmSyncobjHandler::drm_syncobj_state(&mut self) -> &mut DrmSyncobjState
13+fn DrmSyncobjHandler::drm_syncobj_state(&mut self) -> Option<&mut DrmSyncobjState>
14```
15
16`DrmTimeline` constructor now accepts OwnedFd:
17```diff
18-fn DrmTimeline::new(device: &DrmDeviceFd, fd: BorrowedFd<'_>) -> io::Result<Self>
19+fn DrmTimeline::new(device: &DrmDeviceFd, fd: OwnedFd) -> io::Result<Self>
20```
21`DrmSyncPoint::eventfd` now returns `Arc<OwnedFd>`:
22```diff
23-fn DrmSyncPoint::eventfd(&self) -> io::Result<OwnedFd>
24+fn DrmSyncPoint::eventfd(&self) -> io::Result<Arc<OwnedFd>>
25```
26`GbmFramebufferExporter` constructor now accepts `import_node`,
27it will be used to filter DMA-BUFs to only those originating from a specific device before considering them for direct scanout.
28If `import_node` is `None` direct-scanout of client-buffers won't be used.
29```diff
30-fn GbmFramebufferExporter::new(gbm: Device<A>) -> Self
31+fn GbmFramebufferExporter::new(gbm: Device<A>, import_node: Option<DrmNode>) -> Self
32```
33
34### Additions
35
36#### WeakDrmDeviceFd
37```rs
38/// Returns a weak reference to the underlying device
39fn DrmDeviceFd::downgrade(&self) -> WeakDrmDeviceFd;
40/// Construct an empty Weak reference, that will never upgrade successfully
41fn WeakDrmDeviceFd::new() -> Self;
42/// Try to upgrade to a strong reference
43fn WeakDrmDeviceFd::upgrade(&self) -> Option<DrmDeviceFd>;
44```
45
46#### KeyboardHandle::set_modifier_state
47```rs
48/// Set the modifiers state.
49fn KeyboardHandle::set_modifier_state(&self, mods_state: ModifiersState) -> u32;
50/// Serialize modifier state back to be sent to xkb.
51fn ModifiersState::serialize_back(&self, state: &xkb::State) -> SerializedMods;
52```
53
54#### XWaylandKeyboardGrab
55```rs
56/// Get the `zwp_xwayland_keyboard_grab_v1` object that created the grab
57fn XWaylandKeyboardGrab::grab(&self) -> &ZwpXwaylandKeyboardGrabV1;
58/// Grab is now clonable
59impl Clone for XWaylandKeyboardGrab;
60```
61
62#### X11Surface
63```rs
64/// Returns the hints for the underlying X11 window
65fn X11Surface::hints(&self) -> Option<x11rb::properties::WmHints>;
66/// Get the client PID associated with the X11 window.
67fn X11Surface::get_client_pid(&self) -> Result<u32, Box<dyn Error>>;
68```
69
70#### DrmSyncobjState
71```rs
72/// Destroys the state and returns the `GlobalId` for compositors to disable/destroy.
73fn DrmSyncobjState::into_global(self) -> GlobalId;
74/// Sets a new `import_device` to import the syncobj fds and wait on them.
75fn DrmSyncobjState::update_device(&mut self, import_device: DrmDeviceFd);
76```
77
78#### xdg-toplevel-tag-v1
79XdgToplevelTag protocol is now available in `smithay::wayland::xdg_toplevel_tag` module.
80
81#### cursor-shape-v1
82CursorShape is now updated to version `2`
83
84
85## 0.6.0
86
87### Breaking Changes
88
89`RenderContext::draw` callback now accepts a mutable reference
90```diff
91-fn smithay::backend::renderer::element::texture::RenderContext::draw(&mut self, f: impl FnOnce(&T))
92+fn smithay::backend::renderer::element::texture::RenderContext::draw(&mut self, f: impl FnOnce(&mut T))
93```
94
95Framebuffer now requires `Texture` implementation
96```rs
97type smithay::backend::renderer::RendererSuper::Framebuffer: smithay::backend::renderer::Texture
98```
99
100`Output::client_outputs` no longer returns a Vec
101```diff
102-fn smithay::output::Output::client_outputs(&self, client: &Client) -> Vec<WlOutput>;
103+fn smithay::output::Output::client_outputs(&self, client: &Client) -> impl Iterator<Item = WlOutput>;
104```
105DamageBag/DamageSnapshot damage getters got renamed
106```diff
107-fn smithay::backend::renderer::utils::DamageBag::damage(&self) -> impl Iterator<Item = impl Iterator<Item = &Rectangle>>
108+fn smithay::backend::renderer::utils::DamageBag::raw(&self) -> impl Iterator<Item = impl Iterator<Item = &Rectangle>>
109-fn smithay::backend::renderer::utils::DamageSnapshot::damage(&self) -> impl Iterator<Item = impl Iterator<Item = &Rectangle>>
110+fn smithay::backend::renderer::utils::DamageSnapshot::raw(&self) -> impl Iterator<Item = impl Iterator<Item = &Rectangle>>
111```
112RendererSurfaceState::damage now returns a DamageSnapshot
113```diff
114-fn smithay::backend::renderer::utils::RendererSurfaceState::damage(&self) -> impl core::iter::traits::iterator::Iterator<Item = impl core::iter::traits::iterator::Iterator<Item = &smithay::utils::Rectangle<i32, smithay::utils::Buffer>>>
115+fn smithay::backend::renderer::utils::RendererSurfaceState::damage(&self) -> smithay::backend::renderer::utils::DamageSnapshot<i32, smithay::utils::Buffer>
116```
117Client scale can now be fractional
118```diff
119-fn smithay::wayland::compositor::CompositorClientState::client_scale(&self) -> u32
120+fn smithay::wayland::compositor::CompositorClientState::client_scale(&self) -> f64
121-fn smithay::wayland::compositor::CompositorClientState::set_client_scale(&self, new_scale: u32)
122+fn smithay::wayland::compositor::CompositorClientState::set_client_scale(&self, new_scale: f64)
123```
124
125Raw `renderer_id` got replaced with new `smithay::backend::renderer::ContextId` newtype 
126```diff
127-fn smithay::backend::renderer::gles::GlesFrame::id(&self) -> usize;
128+fn smithay::backend::renderer::gles::GlesFrame::context_id(&self) -> ContextId;
129-fn smithay::backend::renderer::gles::GlesRenderer::id(&self) -> usize;
130+fn smithay::backend::renderer::gles::GlesRenderer::context_id(&self) -> ContextId;
131-fn smithay::backend::renderer::glow::GlowFrame::id(&self) -> usize;
132+fn smithay::backend::renderer::glow::GlowFrame::context_id(&self) -> ContextId;
133-fn smithay::backend::renderer::glow::GlowRenderer::id(&self) -> usize;
134+fn smithay::backend::renderer::glow::GlowRenderer::context_id(&self) -> ContextId;
135-fn smithay::backend::renderer::multigpu::MultiFrame::id(&self) -> usize;
136+fn smithay::backend::renderer::multigpu::MultiFrame::context_id(&self) -> ContextId;
137-fn smithay::backend::renderer::multigpu::MultiRenderer::id(&self) -> usize;
138+fn smithay::backend::renderer::multigpu::MultiRenderer::context_id(&self) -> ContextId;
139-fn smithay::backend::renderer::pixman::PixmanFrame::id(&self) -> usize;
140+fn smithay::backend::renderer::pixman::PixmanFrame::context_id(&self) -> ContextId;
141-fn smithay::backend::renderer::pixman::PixmanRenderer::id(&self) -> usize;
142+fn smithay::backend::renderer::pixman::PixmanRenderer::context_id(&self) -> ContextId;
143-fn smithay::backend::renderer::test::DummyFrame::id(&self) -> usize;
144+fn smithay::backend::renderer::test::DummyFrame::context_id(&self) -> ContextId;
145-fn smithay::backend::renderer::test::DummyRenderer::id(&self) -> usize;
146+fn smithay::backend::renderer::test::DummyRenderer::context_id(&self) -> ContextId;
147-fn smithay::backend::renderer::Frame::id(&self) -> usize;
148+fn smithay::backend::renderer::Frame::context_id(&self) -> ContextId;
149-fn smithay::backend::renderer::Renderer::id(&self) -> usize;
150+fn smithay::backend::renderer::Renderer::context_id(&self) -> ContextId;
151-fn smithay::backend::renderer::element::texture::TextureRenderElement::from_static_texture(id: Id, renderer_id: usize, ...) -> Self;
152+fn smithay::backend::renderer::element::texture::TextureRenderElement::from_static_texture(id: Id, context_id: ContextId, ...) -> Self;
153-fn smithay::backend::renderer::element::texture::TextureRenderElement::from_texture_with_damage(id: Id, renderer_id: usize, ...) -> Self;
154+fn smithay::backend::renderer::element::texture::TextureRenderElement::from_texture_with_damage(id: Id, context_id: ContextId, ...) -> Self;
155-fn smithay::backend::renderer::utils::RendererSurfaceState::texture<R>(&self, id: usize) -> Option<&TextureId>;
156+fn smithay::backend::renderer::utils::RendererSurfaceState::texture<R>(&self, id: &ContextId) -> Option<&TextureId>;
157```
158
159`CursorShapeDeviceUserData` now has an additional generic argument
160```diff
161-struct smithay::wayland::cursor_shape::CursorShapeDeviceUserData;
162+struct smithay::wayland::cursor_shape::CursorShapeDeviceUserData<D: SeatHandler>;
163```
164
165The explicit frame buffers got introduced, but for the sake of my sanity those changes are not described here, you can look at: https://github.com/Smithay/smithay/commit/df08c6f29eb6ebfa2fce6fc374590483bcbaf21a
166
167### API Additions
168
169It is now possible to check if the OpenGL context is shared with another.
170```rs
171fn smithay::backend::egl::context::EGLContext::is_shared();
172```
173It is now possible to check that there are no other references to the underlying GL texture.
174```rs
175fn smithay::backend::renderer::gles::GlesTexture::is_unique_reference();
176```
177
178There is a new gles capability for support of fencing and exporting to EGL
179```rs
180smithay::backend::renderer::gles::Capability::ExportFence;
181```
182
183There is a new BlitFrame trait for frames that support blitting contents from/to the current framebuffer to/from another.
184```rs
185trait smithay::backend::renderer::BlitFrame;
186impl BlitFrame for smithay::backend::renderer::gles::GlesFrame;
187impl BlitFrame for smithay::backend::renderer::glow::GlowFrame;
188impl BlitFrame for smithay::backend::renderer::multigpu::MultiFrame;
189```
190
191It is now possible to iterate over all known tokens and their associated data
192```rs
193fn smithay::wayland::xdg_activation::XdgActivationState::tokens() -> impl Iterator<Item = (&XdgActivationToken, &XdgActivationTokenData)>;
194```
195
196There are new errors for missing DRM crtc/connector/plane mapping
197```rs
198smithay::backend::drm::DrmError::{UnknownConnector, UnknownCrtc, UnknownPlane};
199```
200
201Texture has a few new implementations
202```rs
203impl Texture for smithay::backend::renderer::gles::GlesTarget;
204impl Texture for smithay::backend::renderer::multigpu:MultiFramebuffer;
205impl Texture for smithay::backend::renderer::pixman::PixmanTarget;
206impl Texture for smithay::backend::renderer::test::DummyFramebuffer
207```
208
209It is now possible to access WlKeyboard/WlPointer instances
210```rs
211fn smithay::input::keyboard::KeyboardHandle::client_keyboards(&self, client: &Client) -> impl Iterator<Item = WlKeyboard>;
212fn smithay::input::pointer::PointerHandle::client_pointers(&self, client: &:Client) -> impl Iterator<Item = WlPointer>;
213```
214
215New APIs for X11 randr output management 
216```rs
217enum smithay::xwayland::xwm::PrimaryOutputError { OutputUnknown, X11Error(x11rb::errors::ReplyError) };
218
219impl From<x11rb::errors::ConnectionError> for smithay::xwayland::xwm::PrimaryOutputError;
220fn smithay::xwayland::xwm::PrimaryOutputError::from(value: x11rb::errors::ConnectionError) -> Self;
221fn smithay::xwayland::xwm::X11Wm::get_randr_primary_output(&self) -> Result<Option<String>, x11rb::errors::ReplyError>;
222fn smithay::xwayland::xwm::X11Wm::set_randr_primary_output(&mut self, output: Option<&smithay::output::Output>) -> Result<(), smithay::xwayland::xwm::PrimaryOutputError>;
223fn smithay::xwayland::xwm::XwmHandler::randr_primary_output_change(&mut self, xwm: smithay::xwayland::xwm::XwmId, output_name: Option<String>);
224```
225
226It is now possible to get the DrmNode of the device the buffer was allocated on
227```rs
228fn smithay::backend::allocator::gbm::GbmBuffer::device_node(&self) -> Option<drm::node::DrmNode>;
229```
230
231It is now possible to create a `GbmBuffer` from an existing `BufferObject` explicitly defining the device node
232```rs
233fn smithay::backend::allocator::gbm::GbmBuffer::from_bo_with_node(bo: gbm::buffer_object::BufferObject<()>, implicit: bool, drm_node: core::option::Option<drm::node::DrmNode>) -> Self;
234```
235
236It is now possible to access the `Allocator` of this output manager
237```rs
238fn smithay::backend::drm::output::DrmOutputManager::allocator(&self) -> &Allocator;
239```
240
241Is is now possible to check if EGLDevice is backed by actual device node or is it a software device.
242```rs
243fn smithay::backend::egl::EGLDevice::is_software(&self) -> bool
244```
245
246This adds a way to query next deadline of a commit timing barrier.
247Allows a compositor to schedule re-evaluating commit timers without
248busy looping.
249```rs
250fn smithay::wayland::commit_timing::CommitTimerBarrierState::next_deadline(&self) -> Option<smithay::wayland::commit_timing::Timestamp>;
251```
252
253Support for casting `Timestamp` back to `Time`
254This might be useful to compare the next deadline with a monotonic time
255from the presentation clock
256```rs
257impl From<smithay::wayland::commit_timing::Timestamp> for smithay::utils::Time;
258```
259
260Support for creating a weak reference to a `Seat`
261```rs
262fn smithay::input::Seat::downgrade(&self) -> smithay::input::WeakSeat;
263
264fn smithay::input::WeakSeat::is_alive(&self) -> bool;
265pub fn smithay::input::WeakSeat::upgrade(&self) -> Option<smithay::input::Seat>;
266```
267
268## 0.5.0
269
270### API Changes
271Items either removed or deprecated from the public API
272```rs
273/// Use Clone instead
274impl Copy for smithay::utils::HookId;
275/// Use `from_extremities` instead
276fn smithay::utils::Rectangle::from_extemities(topleft, bottomright) -> Self;
277```
278
279Items added to the public API
280```rs
281/// Replaces deprecated `from_extemities`
282fn smithay::utils::Rectangle::from_extremities(topleft, bottomright) -> Self;
283/// Access the active text-input instance for the currently focused surface.
284fn smithay::wayland::text_input::TextInputHandle::with_active_text_input(&self, f);
285/// Just a new protocol
286mod smithay::wayland::selection::ext_data_control;
287```
288
289Items changed in the public API
290```diff
291# create_external_token now accepts `XdgActivationTokenData` instead of `String`
292-fn smithay::wayland::xdg_activation::XdgActivationState::create_external_token(&mut self, app_id: impl Into<Option<String>>);
293+fn smithay::wayland::xdg_activation::XdgActivationState::create_external_token(&mut self, data: impl Into<Option<XdgActivationTokenData>>);
294```
295
296### New protocols
297* Introduce ext data control protocol by @PolyMeilex in https://github.com/Smithay/smithay/pull/1577
298* Update idle notify to version 2 by @PolyMeilex in https://github.com/Smithay/smithay/pull/1618
299
300### TextInput improvements
301* Revert "Fix repeated key input issue in Chrome with multiple windows" by @Drakulix in https://github.com/Smithay/smithay/pull/1647
302* text-input: fix active instance tracking by @kchibisov in https://github.com/Smithay/smithay/pull/1648
303* text-input: properly handle double buffered state by @kchibisov in https://github.com/Smithay/smithay/pull/1649
304
305### Miscellaneous
306* clock: Fix current monotonic time in millis u32 overflow panic by @YaLTeR in https://github.com/Smithay/smithay/pull/1645
307* xwm: Update override-redirect flag on map request by @Ottatop in https://github.com/Smithay/smithay/pull/1656
308* utils: Rework `HookId` recycle logic by @Paraworker in https://github.com/Smithay/smithay/pull/1657
309* rename Rectangle::from_extemities to Rectangle::from_extremeties by @m4rch3n1ng in https://github.com/Smithay/smithay/pull/1646
310* xdg_activation: Allow passing all data in XdgActivationState::create_external_token by @bbb651 in https://github.com/Smithay/smithay/pull/1658
311
312## 0.4.0
313
314### Breaking Changes
315
316**`wayland-server` was updated to 0.30:**
317- Most of the wayland frontend API is changed to follow the new request dispatching mechanism built around the `Dispatch` trait from `wayland-server`
318- Modules that provide handlers for Wayland globals now provide `DelegateDispatch` implementations, as well as macros to simplify the dispatching from your main state
319
320#### Clients & Protocols
321
322- Remove `xdg-shell-unstable-v6` backwards compatibility
323- `XdgPositionerState` moved to `XdgPopupState` and added to `XdgRequest::NewPopup`
324- `PopupSurface::send_configure` now checks the protocol version and returns an `Result`
325- `KeyboardHandle::input` filter closure now receives a `KeysymHandle` instead of a `Keysym` and returns a `FilterResult`.
326- `PointerButtonEvent::button` now returns an `Option<MouseButton>`.
327- `MouseButton` is now non-exhaustive.
328- Remove `Other` and add `Forward` and `Back` variants to `MouseButton`. Use the new `PointerButtonEvent::button_code` in place of `Other`.
329- `GrabStartData` has been renamed to `PointerGrabStartData`
330- The `slot` method on touch events no longer returns an `Option` and multi-touch capability is thus opaque to the compositor
331- `wayland::output::Output` now is created separately from it's `Global` as reflected by [`Output::new`] and the new [`Output::create_global] method.
332- `PointerHandle` no longer sends an implicit motion event when a grab is set, `time` has been replaced by an explicit `focus` parameter in [`PointerHandle::set_grab`]
333- `ToplevelSurface::send_configure`/`PopupSurface::send_configure`/`LayerSurface::send_configure` now always send a configure event regardless of changes and return
334  the serial of the configure event. `send_pending_configure` can be used to only send a configure event on pending changes.
335
336#### Backends
337
338- Rename `WinitInputBacked` to `WinitEventLoop`.
339- Rename `WinitInputError` to `WinitError`;
340- `WinitInputBackend` no longer implements `InputBackend`. Input events are now received from the `WinitEvent::Input` variant.
341- All winit backend internal event types now use `WinitInput` as the backend type.
342- `WinitEventLoop::dispatch_new_events` is now used to receive some `WinitEvent`s.
343- Added `TabletToolType::Unknown` as an option for tablet events
344- `render_texture` was removed from `Frame`, use `render_texture_at` or `render_texture_from_to` instead or use `Gles2Renderer::render_texture` as a direct replacement.
345- Remove `InputBackend::dispatch_new_events`, turning `InputBackend` into a definition of backend event types. Future input backends should be a `calloop::EventSource`.
346- Remove `InputBackend::EventError` associated type as it is unneeded since `dispatch_new_events` was removed.
347- `Swapchain` does not have a generic Userdata-parameter anymore, but utilizes `UserDataMap` instead
348- `GbmBufferedSurface::next_buffer` now additionally returns the age of the buffer
349- `Present` was merged into the `X11Surface`
350- `X11Surface::buffer` now additionally returns the age of the buffer
351- `X11Surface` now has an explicit `submit` function
352- `X11Surface` is now multi-window capable.
353- `Renderer::clear` now expects a second argument to optionally only clear parts of the buffer/surface
354- `Transform::transform_size` now takes a `Size` instead of two `u32`
355- `Gles2Renderer` now automatically flips the `render` result to account for OpenGLs coordinate system
356- `Frame::clear`, `Frame::render_texture_at` and `Frame::render_texture_from_to` now have an additional damage argument
357- `EGLNativeSurface` implementations overriding `swap_buffers` now receive and additional `damage` attribute to be used with `eglSwapBuffersWithDamageEXT` if desired
358- `EGLSurface::swap_buffers` now accepts an optional `damage` parameter
359- `WinitGraphicsBackend` does no longer provide a `render`-method and exposes its `Renderer` directly instead including new functions `bind` and `submit` to handle swapping buffers.
360- `ImportShm` was renamed to `ImportMem`
361- `ImportMem` and `ImportDma` were split and do now have accompanying traits `ImportMemWl` and `ImportDmaWl` to import wayland buffers.
362- Added `EGLSurface::get_size`
363- `EGLDisplay::get_extensions` was renamed to `extensions` and now returns a `&[String]`.
364- Added gesture input events, which are supported with the libinput backend.
365
366### Additions
367
368#### Clients & Protocols
369
370- `xdg_activation_v1` support
371- `wlr-layer-shell-unstable-v1` support
372- Added public api constants for the roles of `wl_shell_surface`, `zxdg_toplevel` and `xdg_toplevel`. See the
373  `shell::legacy` and `shell::xdg` modules for these constants.
374- Whether a surface is toplevel equivalent can be determined with the new function `shell::is_toplevel_equivalent`.
375- Setting the parent of a toplevel surface is now possible with the `xdg::ToplevelSurface::set_parent` function.
376- Add support for the zxdg-foreign-v2 protocol.
377- Support for `xdg_wm_base` protocol version 3
378- Added the option to initialize the dmabuf global with a client filter
379- `wayland::output::Output` now has user data attached to it and more functions to query its properties
380- Added a `KeyboardGrab` similar to the existing `PointerGrab`
381- `wayland::output::Output` now has a `current_scale` method to quickly retrieve its set scale.
382- `wayland::shell::wlr_layer::KeyboardInteractivity` now implements `PartialEq` and `Eq`.
383- Added `TouchHandle` for Wayland client touch support (see `Seat::get_touch`)
384- `wayland::output::Scale` was introduced to handle fractional scale values better
385- Support for `wl_output` global version 4
386- Support for `wl_seat` global version 7
387- Support for `wl_compositor` global version 5
388- Support for the `wp_viewporter` protocol
389- Support for the `zwp_input_method_v2` protocol
390- Support for the `zwp_text_input_v3` protocol
391
392#### Backends
393
394- New `x11` backend to run the compositor as an X11 client. Enabled through the `backend_x11` feature.
395- `x11rb` event source integration used in anvil's XWayland implementation is now part of smithay at `utils::x11rb`. Enabled through the `x11rb_event_source` feature.
396- `KeyState`, `MouseButton`, `ButtonState` and `Axis` in `backend::input` now derive `Hash`.
397- New `DrmNode` type in drm backend. This is primarily for use a backend which needs to run as client inside another session.
398- The button code for a `PointerButtonEvent` may now be obtained using `PointerButtonEvent::button_code`.
399- `Renderer` now allows texture filtering methods to be set.
400- `backend::renderer` has a new `utils`-module that can take care of client buffer management for you.
401- `EGLSurface::buffer_age` can be used to query the surface buffer age.
402- `GbmBufferedSurface::reset_buffers` can now be used to reset underlying buffers.
403- Added new `Offscreen` trait to create offscreen surfaces for `Renderer`s
404- Added functions to `ImportMem` to upload bitmaps from memory
405- Added `ExportDma` trait to export framebuffers and textures into dmabufs
406- Added `ExportMem` trait to copy framebuffers and textures into memory
407- Added `multigpu`-module to the renderer, which makes handling multi-gpu setups easier!
408- Added `backend::renderer::utils::import_surface_tree` to be able to import buffers before rendering
409- Added `EGLContext::display` to allow getting the underlying display of some context.
410- Make `EGLContext::dmabuf_render_formats` and `EGLContext::dmabuf_texture_formats` also accessible from `EGLDisplay`.
411
412#### Desktop
413
414- New `desktop` module to handle window placement, tracks popups, layer surface and various rendering helpers including automatic damage-tracking! (+so much more)
415
416#### Utils
417
418- `Rectangle` can now also be converted from f64 to i32 variants
419- `Rectangle::contains_rect` can be used to check if a rectangle is contained within another
420- `Coordinate` is now part of the public api, so it can be used for coordinate agnositic functions outside of the utils module or even out-of-tree
421
422### Bugfixes
423
424#### Clients & Protocols
425
426- `Multicache::has()` now correctly does what is expected of it
427- `xdg_shell` had an issue where it was possible that configured state gets overwritten before it was acked/committed.
428- `wl_keyboard` rewind the `keymap` file before passing it to the client
429- `wl_shm` properly validates parameters when creating a `wl_buffer`.
430- `ServerDnDGrab` and `DnDGrab` now correctly send data device `leave` event on button release
431- Client are now allowed to reassign the same role to a surface
432- `xdg_output` now applies the output transforms to the reported logical size
433
434#### Backends
435
436- EGLBufferReader now checks if buffers are alive before using them.
437- LibSeat no longer panics on seat disable event.
438- X11 backend will report an error when trying to present a dmabuf fails.
439
440### Anvil
441
442- Anvil now implements the x11 backend in smithay. Run by passing `--x11` into the arguments when launching.
443- Passing `ANVIL_MUTEX_LOG` in environment variables now uses the slower `Mutex` logging drain.
444- Only toplevel surfaces now get implicit keyboard focus
445- Fix popup drawing for fullscreen windows
446
447## version 0.3.0 (2021-07-25)
448
449Large parts of Smithay were changed with numerous API changes. It is thus recommended to
450approach version 0.3 as if it was a new crate altogether compared to 0.2.
451
452The most notable changes are:
453
454- Deep refactor of the graphics backends around a workflows centered on allocating graphics buffers,
455  and a Gles2-based renderer abstraction is provided.
456- Support for DRM atomic modesetting as well as client-provided DMABUF
457- Most backends are now `calloop` event sources generating events. The recommended organization for
458  your smithay-based compositor is thus to centralize most of your logic on a global state struct,
459  and delegate event handling to it via the shared data mechanism of `calloop`. Most of the callbacks
460  you provide to Smithay are given mutable access to this shared data.
461- The `wayland::compositor` handling logic now automatically handles state tracking and delayed commit
462  for wayland surfaces.
463
464Many thanks to the new contributors to Smithay, who contributed the following:
465
466- Support for [`libseat`](https://sr.ht/~kennylevinsen/seatd/) as a session backend, by
467  @PolyMeilex
468- Support for graphics tablets via the `tablet` protocol extension, by @PolyMeilex
469- Support for running Smithay on `aarch64` architectures, by @cmeissl
470- A rework of the `xdg-shell` handlers to better fit the protocol logic and correctly track configure
471  events, by @cmeissl
472- Basic Xwayland support, by @psychon
473
474## version 0.2.0 (2019-01-03)
475
476### General
477
478- **[Breaking]** Upgrade to wayland-rs 0.21
479- **[Breaking]** Moving the public dependencies to a `reexports` module
480- Migrate the codebase to Rust 2018
481
482### Backends
483
484- **[Breaking]** WinitBackend: Upgrade to winit 0.18
485- **[Breaking]** Global refactor of the DRM & Session backends
486- **[Breaking]** Restructuration of the backends around the `calloop` event-loop
487
488### Clients & Protocol
489
490- Basic XWayland support
491- Data device & Drag'n'Drop support
492- Custom client pointers support
493
494## version 0.1.0 (2017-10-01)
495
496### Protocol handling
497
498- Low-level handling routines for several wayland globals:
499  - `wayland::shm` handles `wl_shm`
500  - `wayland::compositor` handles `wl_compositor` and `wl_subcompositor`
501  - `wayland::shell` handles `wl_shell` and `xdg_shell`
502  - `wayland::seat` handles `wl_seat`
503  - `wayland::output` handles `wl_output`
504
505### Backend
506
507- Winit backend (EGL context & input)
508- DRM backend
509- libinput backend
510- glium integration

CHANGELOG.md

Smithay Changelog

Unreleased

0.7.0

Breaking changes

DrmSyncobjHandler::drm_syncobj_state is now Optional. Whenever state is None ImportTimeline request will result in InvalidTimeline protocol error. This allows one to destroy DrmSyncobjState by calling DrmSyncobjState::into_global()

-fn DrmSyncobjHandler::drm_syncobj_state(&mut self) -> &mut DrmSyncobjState
+fn DrmSyncobjHandler::drm_syncobj_state(&mut self) -> Option<&mut DrmSyncobjState>

DrmTimeline constructor now accepts OwnedFd:

-fn DrmTimeline::new(device: &DrmDeviceFd, fd: BorrowedFd<'_>) -> io::Result<Self>
+fn DrmTimeline::new(device: &DrmDeviceFd, fd: OwnedFd) -> io::Result<Self>

DrmSyncPoint::eventfd now returns Arc<OwnedFd>:

-fn DrmSyncPoint::eventfd(&self) -> io::Result<OwnedFd>
+fn DrmSyncPoint::eventfd(&self) -> io::Result<Arc<OwnedFd>>

GbmFramebufferExporter constructor now accepts import_node, it will be used to filter DMA-BUFs to only those originating from a specific device before considering them for direct scanout. If import_node is None direct-scanout of client-buffers won't be used.

-fn GbmFramebufferExporter::new(gbm: Device<A>) -> Self
+fn GbmFramebufferExporter::new(gbm: Device<A>, import_node: Option<DrmNode>) -> Self

Additions

WeakDrmDeviceFd

/// Returns a weak reference to the underlying device
fn DrmDeviceFd::downgrade(&self) -> WeakDrmDeviceFd;
/// Construct an empty Weak reference, that will never upgrade successfully
fn WeakDrmDeviceFd::new() -> Self;
/// Try to upgrade to a strong reference
fn WeakDrmDeviceFd::upgrade(&self) -> Option<DrmDeviceFd>;

KeyboardHandle::set_modifier_state

/// Set the modifiers state.
fn KeyboardHandle::set_modifier_state(&self, mods_state: ModifiersState) -> u32;
/// Serialize modifier state back to be sent to xkb.
fn ModifiersState::serialize_back(&self, state: &xkb::State) -> SerializedMods;

XWaylandKeyboardGrab

/// Get the `zwp_xwayland_keyboard_grab_v1` object that created the grab
fn XWaylandKeyboardGrab::grab(&self) -> &ZwpXwaylandKeyboardGrabV1;
/// Grab is now clonable
impl Clone for XWaylandKeyboardGrab;

X11Surface

/// Returns the hints for the underlying X11 window
fn X11Surface::hints(&self) -> Option<x11rb::properties::WmHints>;
/// Get the client PID associated with the X11 window.
fn X11Surface::get_client_pid(&self) -> Result<u32, Box<dyn Error>>;

DrmSyncobjState

/// Destroys the state and returns the `GlobalId` for compositors to disable/destroy.
fn DrmSyncobjState::into_global(self) -> GlobalId;
/// Sets a new `import_device` to import the syncobj fds and wait on them.
fn DrmSyncobjState::update_device(&mut self, import_device: DrmDeviceFd);

xdg-toplevel-tag-v1

XdgToplevelTag protocol is now available in smithay::wayland::xdg_toplevel_tag module.

cursor-shape-v1

CursorShape is now updated to version 2

0.6.0

Breaking Changes

RenderContext::draw callback now accepts a mutable reference

-fn smithay::backend::renderer::element::texture::RenderContext::draw(&mut self, f: impl FnOnce(&T))
+fn smithay::backend::renderer::element::texture::RenderContext::draw(&mut self, f: impl FnOnce(&mut T))

Framebuffer now requires Texture implementation

type smithay::backend::renderer::RendererSuper::Framebuffer: smithay::backend::renderer::Texture

Output::client_outputs no longer returns a Vec

-fn smithay::output::Output::client_outputs(&self, client: &Client) -> Vec<WlOutput>;
+fn smithay::output::Output::client_outputs(&self, client: &Client) -> impl Iterator<Item = WlOutput>;

DamageBag/DamageSnapshot damage getters got renamed

-fn smithay::backend::renderer::utils::DamageBag::damage(&self) -> impl Iterator<Item = impl Iterator<Item = &Rectangle>>
+fn smithay::backend::renderer::utils::DamageBag::raw(&self) -> impl Iterator<Item = impl Iterator<Item = &Rectangle>>
-fn smithay::backend::renderer::utils::DamageSnapshot::damage(&self) -> impl Iterator<Item = impl Iterator<Item = &Rectangle>>
+fn smithay::backend::renderer::utils::DamageSnapshot::raw(&self) -> impl Iterator<Item = impl Iterator<Item = &Rectangle>>

RendererSurfaceState::damage now returns a DamageSnapshot

-fn smithay::backend::renderer::utils::RendererSurfaceState::damage(&self) -> impl core::iter::traits::iterator::Iterator<Item = impl core::iter::traits::iterator::Iterator<Item = &smithay::utils::Rectangle<i32, smithay::utils::Buffer>>>
+fn smithay::backend::renderer::utils::RendererSurfaceState::damage(&self) -> smithay::backend::renderer::utils::DamageSnapshot<i32, smithay::utils::Buffer>

Client scale can now be fractional

-fn smithay::wayland::compositor::CompositorClientState::client_scale(&self) -> u32
+fn smithay::wayland::compositor::CompositorClientState::client_scale(&self) -> f64
-fn smithay::wayland::compositor::CompositorClientState::set_client_scale(&self, new_scale: u32)
+fn smithay::wayland::compositor::CompositorClientState::set_client_scale(&self, new_scale: f64)

Raw renderer_id got replaced with new smithay::backend::renderer::ContextId newtype

-fn smithay::backend::renderer::gles::GlesFrame::id(&self) -> usize;
+fn smithay::backend::renderer::gles::GlesFrame::context_id(&self) -> ContextId;
-fn smithay::backend::renderer::gles::GlesRenderer::id(&self) -> usize;
+fn smithay::backend::renderer::gles::GlesRenderer::context_id(&self) -> ContextId;
-fn smithay::backend::renderer::glow::GlowFrame::id(&self) -> usize;
+fn smithay::backend::renderer::glow::GlowFrame::context_id(&self) -> ContextId;
-fn smithay::backend::renderer::glow::GlowRenderer::id(&self) -> usize;
+fn smithay::backend::renderer::glow::GlowRenderer::context_id(&self) -> ContextId;
-fn smithay::backend::renderer::multigpu::MultiFrame::id(&self) -> usize;
+fn smithay::backend::renderer::multigpu::MultiFrame::context_id(&self) -> ContextId;
-fn smithay::backend::renderer::multigpu::MultiRenderer::id(&self) -> usize;
+fn smithay::backend::renderer::multigpu::MultiRenderer::context_id(&self) -> ContextId;
-fn smithay::backend::renderer::pixman::PixmanFrame::id(&self) -> usize;
+fn smithay::backend::renderer::pixman::PixmanFrame::context_id(&self) -> ContextId;
-fn smithay::backend::renderer::pixman::PixmanRenderer::id(&self) -> usize;
+fn smithay::backend::renderer::pixman::PixmanRenderer::context_id(&self) -> ContextId;
-fn smithay::backend::renderer::test::DummyFrame::id(&self) -> usize;
+fn smithay::backend::renderer::test::DummyFrame::context_id(&self) -> ContextId;
-fn smithay::backend::renderer::test::DummyRenderer::id(&self) -> usize;
+fn smithay::backend::renderer::test::DummyRenderer::context_id(&self) -> ContextId;
-fn smithay::backend::renderer::Frame::id(&self) -> usize;
+fn smithay::backend::renderer::Frame::context_id(&self) -> ContextId;
-fn smithay::backend::renderer::Renderer::id(&self) -> usize;
+fn smithay::backend::renderer::Renderer::context_id(&self) -> ContextId;
-fn smithay::backend::renderer::element::texture::TextureRenderElement::from_static_texture(id: Id, renderer_id: usize, ...) -> Self;
+fn smithay::backend::renderer::element::texture::TextureRenderElement::from_static_texture(id: Id, context_id: ContextId, ...) -> Self;
-fn smithay::backend::renderer::element::texture::TextureRenderElement::from_texture_with_damage(id: Id, renderer_id: usize, ...) -> Self;
+fn smithay::backend::renderer::element::texture::TextureRenderElement::from_texture_with_damage(id: Id, context_id: ContextId, ...) -> Self;
-fn smithay::backend::renderer::utils::RendererSurfaceState::texture<R>(&self, id: usize) -> Option<&TextureId>;
+fn smithay::backend::renderer::utils::RendererSurfaceState::texture<R>(&self, id: &ContextId) -> Option<&TextureId>;

CursorShapeDeviceUserData now has an additional generic argument

-struct smithay::wayland::cursor_shape::CursorShapeDeviceUserData;
+struct smithay::wayland::cursor_shape::CursorShapeDeviceUserData<D: SeatHandler>;

The explicit frame buffers got introduced, but for the sake of my sanity those changes are not described here, you can look at: https://github.com/Smithay/smithay/commit/df08c6f29eb6ebfa2fce6fc374590483bcbaf21a

API Additions

It is now possible to check if the OpenGL context is shared with another.

fn smithay::backend::egl::context::EGLContext::is_shared();

It is now possible to check that there are no other references to the underlying GL texture.

fn smithay::backend::renderer::gles::GlesTexture::is_unique_reference();

There is a new gles capability for support of fencing and exporting to EGL

smithay::backend::renderer::gles::Capability::ExportFence;

There is a new BlitFrame trait for frames that support blitting contents from/to the current framebuffer to/from another.

trait smithay::backend::renderer::BlitFrame;
impl BlitFrame for smithay::backend::renderer::gles::GlesFrame;
impl BlitFrame for smithay::backend::renderer::glow::GlowFrame;
impl BlitFrame for smithay::backend::renderer::multigpu::MultiFrame;

It is now possible to iterate over all known tokens and their associated data

fn smithay::wayland::xdg_activation::XdgActivationState::tokens() -> impl Iterator<Item = (&XdgActivationToken, &XdgActivationTokenData)>;

There are new errors for missing DRM crtc/connector/plane mapping

smithay::backend::drm::DrmError::{UnknownConnector, UnknownCrtc, UnknownPlane};

Texture has a few new implementations

impl Texture for smithay::backend::renderer::gles::GlesTarget;
impl Texture for smithay::backend::renderer::multigpu:MultiFramebuffer;
impl Texture for smithay::backend::renderer::pixman::PixmanTarget;
impl Texture for smithay::backend::renderer::test::DummyFramebuffer

It is now possible to access WlKeyboard/WlPointer instances

fn smithay::input::keyboard::KeyboardHandle::client_keyboards(&self, client: &Client) -> impl Iterator<Item = WlKeyboard>;
fn smithay::input::pointer::PointerHandle::client_pointers(&self, client: &:Client) -> impl Iterator<Item = WlPointer>;

New APIs for X11 randr output management

enum smithay::xwayland::xwm::PrimaryOutputError { OutputUnknown, X11Error(x11rb::errors::ReplyError) };

impl From<x11rb::errors::ConnectionError> for smithay::xwayland::xwm::PrimaryOutputError;
fn smithay::xwayland::xwm::PrimaryOutputError::from(value: x11rb::errors::ConnectionError) -> Self;
fn smithay::xwayland::xwm::X11Wm::get_randr_primary_output(&self) -> Result<Option<String>, x11rb::errors::ReplyError>;
fn smithay::xwayland::xwm::X11Wm::set_randr_primary_output(&mut self, output: Option<&smithay::output::Output>) -> Result<(), smithay::xwayland::xwm::PrimaryOutputError>;
fn smithay::xwayland::xwm::XwmHandler::randr_primary_output_change(&mut self, xwm: smithay::xwayland::xwm::XwmId, output_name: Option<String>);

It is now possible to get the DrmNode of the device the buffer was allocated on

fn smithay::backend::allocator::gbm::GbmBuffer::device_node(&self) -> Option<drm::node::DrmNode>;

It is now possible to create a GbmBuffer from an existing BufferObject explicitly defining the device node

fn smithay::backend::allocator::gbm::GbmBuffer::from_bo_with_node(bo: gbm::buffer_object::BufferObject<()>, implicit: bool, drm_node: core::option::Option<drm::node::DrmNode>) -> Self;

It is now possible to access the Allocator of this output manager

fn smithay::backend::drm::output::DrmOutputManager::allocator(&self) -> &Allocator;

Is is now possible to check if EGLDevice is backed by actual device node or is it a software device.

fn smithay::backend::egl::EGLDevice::is_software(&self) -> bool

This adds a way to query next deadline of a commit timing barrier. Allows a compositor to schedule re-evaluating commit timers without busy looping.

fn smithay::wayland::commit_timing::CommitTimerBarrierState::next_deadline(&self) -> Option<smithay::wayland::commit_timing::Timestamp>;

Support for casting Timestamp back to Time This might be useful to compare the next deadline with a monotonic time from the presentation clock

impl From<smithay::wayland::commit_timing::Timestamp> for smithay::utils::Time;

Support for creating a weak reference to a Seat

fn smithay::input::Seat::downgrade(&self) -> smithay::input::WeakSeat;

fn smithay::input::WeakSeat::is_alive(&self) -> bool;
pub fn smithay::input::WeakSeat::upgrade(&self) -> Option<smithay::input::Seat>;

0.5.0

API Changes

Items either removed or deprecated from the public API

/// Use Clone instead
impl Copy for smithay::utils::HookId;
/// Use `from_extremities` instead
fn smithay::utils::Rectangle::from_extemities(topleft, bottomright) -> Self;

Items added to the public API

/// Replaces deprecated `from_extemities`
fn smithay::utils::Rectangle::from_extremities(topleft, bottomright) -> Self;
/// Access the active text-input instance for the currently focused surface.
fn smithay::wayland::text_input::TextInputHandle::with_active_text_input(&self, f);
/// Just a new protocol
mod smithay::wayland::selection::ext_data_control;

Items changed in the public API

# create_external_token now accepts `XdgActivationTokenData` instead of `String`
-fn smithay::wayland::xdg_activation::XdgActivationState::create_external_token(&mut self, app_id: impl Into<Option<String>>);
+fn smithay::wayland::xdg_activation::XdgActivationState::create_external_token(&mut self, data: impl Into<Option<XdgActivationTokenData>>);

New protocols

TextInput improvements

Miscellaneous

0.4.0

Breaking Changes

wayland-server was updated to 0.30:

Clients & Protocols

Backends

Additions

Clients & Protocols

Backends

Desktop

Utils

Bugfixes

Clients & Protocols

Backends

Anvil

version 0.3.0 (2021-07-25)

Large parts of Smithay were changed with numerous API changes. It is thus recommended to approach version 0.3 as if it was a new crate altogether compared to 0.2.

The most notable changes are:

Many thanks to the new contributors to Smithay, who contributed the following:

version 0.2.0 (2019-01-03)

General

Backends

Clients & Protocol

version 0.1.0 (2017-10-01)

Protocol handling

Backend