Releases: Smithay/smithay
v0.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>) -> SelfAdditions
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
Credits
- feat: implement KeyboardHandle::set_modifier_state by @erdii in #1721
- xwayland_keyboard_grab:
Cloneimpl and accessor forZwpXwaylandKeyboardGrabV1by @ids1024 in #1727 - Update
randandthiserrordependencies by @ids1024 in #1703 - Fix incorrect tablet pen tilt handling in
libinputbackend by @eepysillycat in #1730 - input/keyboard: Use hash for ID of
KeymapFileby @ids1024 in #1740 - fix: store updated mods_state in KbdInternal in KeyboardHandle.set_modifier_state by @erdii in #1734
- wayland: XDG toplevel tag protocol by @PolyMeilex in #1728
- impl Div for Size<N, Kind> by @m4rch3n1ng in #1733
- update to rustix 1.0 by @m4rch3n1ng in #1736
- implement a Point::new and a Size::new constructor by @m4rch3n1ng in #1732
- add get client id to x11 surface #2 by @PapyElGringo in #1741
- Expose x11 hints by @PapyElGringo in #1731
- chore: clippy fixes by @Drakulix in #1742
- wayland/cursor_shape: update to version 2 by @m4rch3n1ng in #1746
- wayland/drm_syncobj: Allow somewhat graceful migration/destruction by @Drakulix in #1739
- gles: Don't call
GenTexturesbeforemake_current()by @ids1024 in #1748 - compositor: Fix potential deadlocks locking parents by @Drakulix in #1749
- compositor/gbm: Don't scanout client buffers without explicit node matches by @Drakulix in #1755
New Contributors
- @erdii made their first contribution in #1721
- @eepysillycat made their first contribution in #1730
Full Changelog: v0.6.0...v0.7.0
v0.6.0 Striking the Anvil
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::TextureOutput::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: df08c6f
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::DummyFramebufferIt 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) -> boolThis 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>;v0.5.0 The nameless smith
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;Changes 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
- Introduce ext data control protocol by @PolyMeilex in #1577
- Update idle notify to version 2 by @PolyMeilex in #1618
TextInput improvements
- Revert "Fix repeated key input issue in Chrome with multiple windows" by @Drakulix in #1647
- text-input: fix active instance tracking by @kchibisov in #1648
- text-input: properly handle double buffered state by @kchibisov in #1649
Miscellaneous fixes
- clock: Fix current monotonic time in millis u32 overflow panic by @YaLTeR in #1645
- xwm: Update override-redirect flag on map request by @Ottatop in #1656
- utils: Rework
HookIdrecycle logic by @Paraworker in #1657 - rename Rectangle::from_extemities to Rectangle::from_extremeties by @m4rch3n1ng in #1646
- xdg_activation: Allow passing all data in XdgActivationState::create_external_token by @bbb651 in #1658
Full Changelog: v0.4.0...v0.5.0
v0.4.0 Gathering raw ores
So... It's been 3.5 years since the last release, but by no means has the project lost its steam, it's quite the opposite, it's more lively than ever. The reason for the release gap is simply the fact that we all got used to using cargo git dependencies, for the constant stream of latest and greatest features.
Wayland-rs 0.30
The big highlight of 0.4 is the development of wayland-rs 0.30 by @elinorbgr followed by the porting of Smithay to it by @PolyMeilex @i509VCB and @Drakulix which changed the design direction of the project significantly and opened a lot of new possibilities when it comes to Smithay's API design.
Desktop & Rendering Abstractions
Introduced by @Drakulix desktop abstractions solve a lot of the busy work needed for a typical desktop shell, they introduce 2D Spaces that elements like TopLevels and Layers can be mapped onto for easier tracking of popups, z-order and most importantly, full damage tracking via RenderElements.
As a cherry on top, you can combine this with the new DrmCompositor abstraction by @cmeissl to achieve proper DRM Planes support and fully leverage your hardware's capabilities.
New Protocols
- WLR Layer Shell protocol by @PolyMeilex in #354
- XDG activation protocol by @PolyMeilex in #358
- XDG decoration protocol by @PolyMeilex in #394
- Add wl-touch support by @chrisduerr in #499
- Add support for viewporter by @cmeissl in #588
- Add support for the wp_primary_selection protocol by @Drakulix in #670
- Input method and text input protocols by @rano-oss in #443
- KDE server-decoration protocol by @chrisduerr in #410
- Shortcuts inhibit protocol by @PolyMeilex in #687
- Virtual keyboard protocol by @rano-oss in #720
- wp presentation protocol by @cmeissl in #794
- Support fractional scale by @cmeissl in #840
- Relative pointer protocol by @ids1024 in #757
- XDG shell versions 3,4,5 by @cmeissl
- XDG shell version 6 by @PolyMeilex in #1130
- WpContentType protocol by @PolyMeilex in #1011
zwp_idle_inhibitprotocol by @chrisduerr in #1004- Security Context protocol by @ids1024 in #1106
- zwp_pointer_gestures_v1 protocol by @YaLTeR in #1114
- Pointer constraints protocol by @ids1024 in #872
- drm leasing by @Drakulix in #1132
- cursor_shape_v1 protocol by @kchibisov in #1154
- wlr-data-control protocol by @kchibisov in #1151
- ext-session-lock protocol by @YaLTeR in #1166
- High res scrolling support (
wl_pointerversion 8) by @ids1024 in #1246 - Implement
axis_relative_direction(wl_pointerversion 9) by @ids1024 in #1253 - ext-idle-notify protocol by @YaLTeR in #1320
- XdgForeign protocol by @PolyMeilex in #1342
- XWayland shell protocol by @colinmarc in #1351
- wp alpha modifier protocol by @PolyMeilex in #1426
- XDG Dialog protocol by @PolyMeilex in #1389
- foreign_toplevel_list protocol by @PolyMeilex in #1513
- xdg_toplevel_icon protocol by @PolyMeilex in #1512
- linux-drm-syncobj-v1 protocol by @ids1024 in #1356
- xdg_system_bell protocol by @PolyMeilex in #1566
- wl_shm version 2 by @PolyMeilex in #1532
- fifo-v1 and commit-timing-v1 protocol by @cmeissl in #1588
Backend changes
- X11 backend by @i509VCB in #371
- Desktop abstractions by @Drakulix in #423
- Popup grabs for desktop abstraction by @cmeissl in #467
- Add support for GPUs without instanced rendering by @chrisduerr in #495
- Introduce MultiGPU renderer by @Drakulix in #503
- Feature/opaque regions by @cmeissl in #659
- The Vulkan allocator by @i509VCB in #614
- input: Split off input-handling and wayland-specific seat handling by @Drakulix in #689
- renderer: Add glow integration by @Drakulix in #744
- X11 wm in smithay by @Drakulix in #570
- gles2: custom shaders by @Drakulix in #901
- DRM planes with DrmCompositor by @cmeissl in #760
- Introduce DRM abstractions crate by @PolyMeilex in #924
- Surface Transactions by @Drakulix in #1009
- Perf optimizations by @cmeissl in #1086 & #1128
- Feature/software renderer by @cmeissl in #1228
- Perf/tiled renderers by @cmeissl in #1449
- libdisplay-info integration by @cmeissl in #1522
- DrmOutputManager by @cmeissl in #1576
And many more changes that would take to long to list: v0.3.0...v0.4.0
Version 0.3: Raising the heat
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:
- Deep refactor of the graphics backends around a workflows centered on allocating graphics buffers, and a Gles2-based renderer abstraction is provided.
- Support for DRM atomic modesetting as well as client-provided DMABUF
- Most backends are now calloop event sources generating events. The recommended organization for your smithay-based compositor is thus to centralize most of your logic on a global state struct, and delegate event handling to it via the shared data mechanism of calloop. Most of the callbacks you provide to Smithay are given mutable access to this shared data.
- The
wayland::compositorhandling logic now automatically handles state tracking and delayed commit for wayland surfaces.
Many thanks to the new contributors to Smithay, who contributed the following:
- Support for libseat as a session backend, by @PolyMeilex
- Support for graphics tablets via the tablet protocol extension, by @PolyMeilex
- Support for running Smithay on aarch64 architectures, by @cmeissl
- A rework of the xdg-shell handlers to better fit the protocol logic and correctly track configure events, by @cmeissl
- Basic Xwayland support, by @psychon
First release: Building the hearth
This is the first release of smithay, the rusty wayland compositor smithy.
This release brings the very bases necessary to start building a wayland compositor, namely:
- some logic to handle the most fundamental parts of the wayland protocol
- a backend system, allowing you to start you compositor either as a window client using winit (useful for testing) or directly in a TTY (though this last one is still experimental)
Changelog for version 0.1.0 (2017-10-01)
Protocol handling
- Low-level handling routines for several wayland globals:
wayland::shmhandleswl_shmwayland::compositorhandleswl_compositorandwl_subcompositorwayland::shellhandleswl_shellandwdg_shellwayland::seathandleswl_seatwayland::outputhandleswl_output
Backend
- Winit backend (EGL context & input)
- DRM backend
- libinput backend
- glium integration