Skip to content

Releases: Smithay/smithay

v0.7.0

24 Jun 21:18
a166cf4

Choose a tag to compare

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

Credits

New Contributors

Full Changelog: v0.6.0...v0.7.0

v0.6.0 Striking the Anvil

25 Apr 19:08
f85d06a

Choose a tag to compare

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: 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::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>;

v0.5.0 The nameless smith

27 Feb 17:37
c579dd9

Choose a tag to compare

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

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 HookId recycle 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

23 Jan 18:08
2ae322b

Choose a tag to compare

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

Backend changes

And many more changes that would take to long to list: v0.3.0...v0.4.0

Version 0.3: Raising the heat

25 Jul 10:02
v0.3.0
46209cf

Choose a tag to compare

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::compositor handling 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

01 Oct 21:15
v0.1.0
dca932b

Choose a tag to compare

Pre-release

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::shm handles wl_shm
    • wayland::compositor handles wl_compositor and wl_subcompositor
    • wayland::shell handles wl_shell and wdg_shell
    • wayland::seat handles wl_seat
    • wayland::output handles wl_output

Backend

  • Winit backend (EGL context & input)
  • DRM backend
  • libinput backend
  • glium integration