Watch
1
0
Fork
You've already forked smithay
0

fix: typos

use typos to find all typos and fix it
and add typos.toml for lib nix
This commit is contained in:
ShootingStarDragons 2026-02-02 23:09:01 +09:00 • committed by Victoria Brekenfeld
commit 3c56055d39
59 changed files with 113 additions and 109 deletions

View file

@ -232,7 +232,7 @@ fn ModifiersState::serialize_back(&self, state: &xkb::State) -> SerializedMods;
```rs
/// Get the `zwp_xwayland_keyboard_grab_v1` object that created the grab
fn XWaylandKeyboardGrab::grab(&self) -> &ZwpXwaylandKeyboardGrabV1;
/// Grab is now clonable
/// Grab is now cloneable
impl Clone for XWaylandKeyboardGrab;
```
@ -483,7 +483,7 @@ Items changed in the public API
* clock: Fix current monotonic time in millis u32 overflow panic by @YaLTeR in https://github.com/Smithay/smithay/pull/1645
* xwm: Update override-redirect flag on map request by @Ottatop in https://github.com/Smithay/smithay/pull/1656
* utils: Rework `HookId` recycle logic by @Paraworker in https://github.com/Smithay/smithay/pull/1657
* rename Rectangle::from_extemities to Rectangle::from_extremeties by @m4rch3n1ng in https://github.com/Smithay/smithay/pull/1646
* rename Rectangle::from_extemities to Rectangle::from_extremities by @m4rch3n1ng in https://github.com/Smithay/smithay/pull/1646
* xdg_activation: Allow passing all data in XdgActivationState::create_external_token by @bbb651 in https://github.com/Smithay/smithay/pull/1658
## 0.4.0

View file

@ -14,7 +14,7 @@ use matrix, this room is also bridged to libera.chat IRC on #smithay.
## Scope
Smithay attempts to be as generic and un-opinionated as possible. As such, if you have an idea of a feature that would be usefull
Smithay attempts to be as generic and un-opinionated as possible. As such, if you have an idea of a feature that would be useful
for your compositor project and would like it to be integrated in Smithay, please consider whether it is in its scope:
- If this is a very generic feature that probably many different projects would find useful, it can be integrated in Smithay

View file

@ -1349,7 +1349,7 @@ impl AnvilState<UdevData> {
.unwrap_or(true)
{
// However, if we need to do a copy, that might not be enough.
// (And without actual comparision to previous frames we cannot really know.)
// (And without actual comparison to previous frames we cannot really know.)
// So lets ignore that in those cases to avoid thrashing performance.
trace!("scheduling repaint timer immediately on {:?}", crtc);
Timer::immediate()

View file

@ -101,7 +101,7 @@ pub fn run_x11() {
let display = Display::new().unwrap();
let mut display_handle = display.handle();
let backend = X11Backend::new().expect("Failed to initilize X11 backend");
let backend = X11Backend::new().expect("Failed to initialize X11 backend");
let handle = backend.handle();
// Obtain the DRM node the X server uses for direct rendering.

View file

@ -261,7 +261,7 @@ pub fn send_frames_surface_tree(surface: &wl_surface::WlSurface, time: u32) {
|_, _, &()| TraversalAction::DoChildren(()),
|_surf, states, &()| {
// the surface may not have any user_data if it is a subsurface and has not
// yet been commited
// yet been committed
for callback in states
.cached_state
.get::<SurfaceAttributes>()

View file

@ -6,4 +6,4 @@ This crate contains some extra abstractions and helpers over DRM
- `drm_scanner` module contains helpers for detecting connector connected and disconnected events as well as mapping crtc to them.
- `ConnectorScanner` is responsible for tracking connected/disconnected events.
- `CrtcMapper` trait and `SimpleCrtcMapper` are meant for mapping crtc to connector.
- `DrmScanner<CrtcMapper>` combines two above into single abstraction. If it does not fit your needs you can always drop down to using `ConnectoScanner` alone.
- `DrmScanner<CrtcMapper>` combines two above into single abstraction. If it does not fit your needs you can always drop down to using `ConnectScanner` alone.

View file

@ -3,7 +3,7 @@
//! - [`ConnectorScanner`] is responsible for tracking connected/disconnected events.
//! - [`CrtcMapper`] trait and [`SimpleCrtcMapper`] are meant for mapping crtc to connector.
//! - [`DrmScanner`] combines two above into single abstraction.
//! If it does not fit your needs you can always drop down to using [`ConnectoScanner`] alone.
//! If it does not fit your needs you can always drop down to using [`ConnectScanner`] alone.
//!
//! ### Example
//! ```no_run

View file

@ -60,7 +60,7 @@ impl SimpleCrtcMapper {
self.is_available(&crtc).then_some(crtc)
}
fn pick_next_avalible_for_connector(
fn pick_next_available_for_connector(
&self,
drm: &impl ControlDevice,
connector: &connector::Info,
@ -110,7 +110,7 @@ impl super::CrtcMapper for SimpleCrtcMapper {
});
for connector in needs_crtc {
if let Some(crtc) = self.pick_next_avalible_for_connector(drm, connector) {
if let Some(crtc) = self.pick_next_available_for_connector(drm, connector) {
self.crtcs.insert(connector.handle(), crtc);
}
}

View file

@ -497,7 +497,7 @@ impl error::Error for AnyError {
}
}
/// Wrapper for Allocators, whos buffer types implement [`AsDmabuf`].
/// Wrapper for Allocators, whose buffer types implement [`AsDmabuf`].
///
/// Implements `Allocator<Buffer=Dmabuf, Error=AnyError>`
#[derive(Debug)]

View file

@ -2404,7 +2404,7 @@ where
supports_fencing: self.supports_fencing,
};
// We only store the next frame if it acutaly contains any changes or if a commit is pending
// We only store the next frame if it actually contains any changes or if a commit is pending
// Storing the (empty) frame could keep a reference to wayland buffers which
// could otherwise be potentially released on `frame_submitted`
if !next_frame.is_empty() {
@ -3173,7 +3173,7 @@ where
if !render && !reposition {
let mut plane_state = previous_state.plane_state(plane_info.handle).unwrap().clone();
plane_state.skip = true;
// Note: we know that we had a cusor plane in the
// Note: we know that we had a cursor plane in the
// previous frame and that nothing changed. In this
// case skip the whole testing
plane_state.needs_test = false;
@ -3186,7 +3186,7 @@ where
trace!("repositioning cursor plane");
let mut plane_state = previous_state.plane_state(plane_info.handle).unwrap().clone();
plane_state.skip = false;
// Note: we know that we had a cusor plane in the
// Note: we know that we had a cursor plane in the
// previous frame, so we assume a simple location change
// does not not to be tested
plane_state.needs_test = false;
@ -3481,7 +3481,7 @@ where
let previous_fb_cache = self
.previous_element_states
.get_mut(element_id)
// Note: We can mem::take the old fb_cache here here as we guarante that
// Note: We can mem::take the old fb_cache here here as we guarantee that
// the element state will always overwrite the current state at the end of render_frame
.map(|state| std::mem::take(&mut state.fb_cache))
.unwrap_or_default();
@ -3653,7 +3653,7 @@ where
});
if !(primary_plane_changed || overlay_plane_changed) {
// we now know that nothing changed and we can assume any previouly failed
// we now know that nothing changed and we can assume any previously failed
// test will again fail
let instance_state = element_state
.instances

View file

@ -502,7 +502,7 @@ pub enum DrmEvent {
/// Timing metadata for page-flip events
#[derive(Debug, Clone, Copy)]
pub struct EventMetadata {
/// The time the frame flip happend
/// The time the frame flip happened
pub time: Time,
/// The sequence number of the frame
pub sequence: u32,

View file

@ -23,7 +23,7 @@ pub struct AccessError {
#[derive(thiserror::Error, Debug)]
pub enum Error {
/// Unable to acquire DRM master
#[error("Failed to aquire DRM master")]
#[error("Failed to acquire DRM master")]
DrmMasterFailed,
/// The `DrmDevice` encountered an access error
#[error(transparent)]

View file

@ -1,4 +1,4 @@
//! Implementation for ExportFramebuffer and related utilizies for dumb buffers
//! Implementation for ExportFramebuffer and related utilities for dumb buffers
use thiserror::Error;

View file

@ -107,7 +107,7 @@ impl<A: AsFd + 'static> ExportFramebuffer<GbmBuffer> for GbmFramebufferExporter<
let node = crate::wayland::dmabuf::get_dmabuf(buffer).unwrap().node();
self.import_node == node
}
// Argubly we need specialization here. If the renderer (which we have in `element_config`, which calls this function)
// Arguably we need specialization here. If the renderer (which we have in `element_config`, which calls this function)
// has `ImportEGL`, we can verify that `EGLBufferRender` is some, which means we have the renderer advertised via wl_drm,
// which means this is probably fine.
// If we don't have `ImportEGL` or `EGLBufferReader` is none, we should reject this, but we don't want to require `ImportEGL`.

View file

@ -231,7 +231,7 @@ where
match drm.test_state([plane_state], true) {
Ok(_) => {
debug!("Choosen format: {:?}", format);
debug!("Chosen format: {:?}", format);
Ok((buffer, swapchain, use_opaque))
}
Err(err) => {
@ -543,10 +543,10 @@ pub enum Error<E: std::error::Error + Send + Sync + 'static> {
#[error("Failed to render test frame")]
InitialRenderingError,
/// Error accessing the drm device
#[error("The underlying drm surface encounted an error: {0}")]
#[error("The underlying drm surface encountered an error: {0}")]
DrmError(#[from] DrmError),
/// Error importing the rendered buffer to libgbm for scan-out
#[error("The underlying gbm device encounted an error: {0}")]
#[error("The underlying gbm device encountered an error: {0}")]
GbmError(#[source] E),
/// Error exporting as Dmabuf
#[error("The allocated buffer could not be exported as a dmabuf: {0}")]

View file

@ -24,7 +24,7 @@ pub struct State {
impl State {
fn current_state<A: DevPath + ControlDevice>(fd: &A, crtc: crtc::Handle) -> Result<Self, Error> {
// Try to enumarate the current state to set the initial state variable correctly.
// Try to enumerate the current state to set the initial state variable correctly.
// We need an accurate state to handle `commit_pending`.
let crtc_info = fd.get_crtc(crtc).map_err(|source| {
Error::Access(AccessError {
@ -68,7 +68,7 @@ impl State {
}
}
// If we have no current mode, we create a fake one, which will not match (and thus gets overriden on the commit below).
// If we have no current mode, we create a fake one, which will not match (and thus gets overridden on the commit below).
// A better fix would probably be making mode an `Option`, but that would mean
// we need to be sure, we require a mode to always be set without relying on the compiler.
// So we cheat, because it works and is easier to handle later.

View file

@ -352,7 +352,7 @@ impl DrmSurface {
}
}
/// Returns true whenever any state changes are pending to be commited
/// Returns true whenever any state changes are pending to be committed
///
/// The following functions may trigger a pending commit:
/// - [`add_connector`](DrmSurface::add_connector)

View file

@ -204,8 +204,8 @@ impl EGLDevice {
}
}
/// Returns the drm node beloging to this device.
/// Tries to optain a render_node first through `EGL_EXT_device_drm_render_node`
/// Returns the drm node belonging to this device.
/// Tries to obtain a render_node first through `EGL_EXT_device_drm_render_node`
/// (see also [`EGLDevice::render_device_path`]) and then falls back to
/// get a render_node from `EGL_EXT_device_drm` (see also [`EGLDevice::drm_device_path`]).
/// If both fail to produce a render node, whichever device returned by

View file

@ -185,7 +185,7 @@ impl From<MakeCurrentError> for GraphicsSwapBuffersError {
From khronos docs:
If the previous context of the calling thread has unflushed commands, and the previous surface is no longer valid, an EGL_BAD_CURRENT_SURFACE error is generated.
This does not consern this or future `makeCurrent`-calls.
This does not concern this or future `makeCurrent`-calls.
*/
x @ MakeCurrentError(EGLError::BadCurrentSurface) => {
GraphicsSwapBuffersError::TemporaryFailure(Box::new(x))

View file

@ -38,7 +38,7 @@ pub trait Device: PartialEq + Eq + std::hash::Hash {
/// Set of input types a device may provide
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[allow(missing_docs)] // self explainatory
#[allow(missing_docs)] // self explanatory
pub enum DeviceCapability {
Keyboard,
Pointer,

View file

@ -170,7 +170,7 @@ where
}
fn wheel_delta_discrete(&self) -> i32 {
// I have no idea why f64 is returend by this fn, in libinput's api wheel clicks are always i32
// I have no idea why f64 is returned by this fn, in libinput's api wheel clicks are always i32
tablet_tool::TabletToolEventTrait::wheel_delta_discrete(self) as i32
}

View file

@ -90,7 +90,7 @@ pub enum KindEvaluation {
Static(Kind),
/// Dynamic evaluation, which will return a [`Kind`] based on the [`SurfaceData`]
Dynamic(fn(&SurfaceData) -> Kind),
/// Dyanmic evaluation, which will return a [`Kind`] based on the [`SurfaceData`] and potentially additional captured context.
/// Dynamic evaluation, which will return a [`Kind`] based on the [`SurfaceData`] and potentially additional captured context.
Closure(Box<dyn Fn(&SurfaceData) -> Kind>),
}

View file

@ -69,8 +69,8 @@ pub enum GlesError {
/// The blitting operation was unsuccessful
#[error("Error blitting between framebuffers")]
BlitError,
/// An error occured while creating the shader object.
#[error("An error occured while creating the shader object.")]
/// An error occurred while creating the shader object.
#[error("An error occurred while creating the shader object.")]
CreateShaderObject,
/// Uniform was not declared when compiling shader
#[error("Uniform {0:?} was not declared when compiling the provided shader")]

View file

@ -161,7 +161,7 @@ pub struct GlesTarget<'a>(GlesTargetInternal<'a>);
enum GlesTargetInternal<'a> {
Image {
// TODO: Ideally we would be able to share the texture between renderers with shared EGLContexts though.
// But we definitly don't want to add user data to a dmabuf to facilitate this. Maybe use the EGLContexts userdata for storing the buffers?
// But we definitely don't want to add user data to a dmabuf to facilitate this. Maybe use the EGLContexts userdata for storing the buffers?
buf: GlesBuffer,
dmabuf: &'a mut Dmabuf,
},
@ -651,7 +651,7 @@ impl GlesRenderer {
version::GLES_2_0
});
// required for the manditory wl_shm formats
// required for the mandatory wl_shm formats
if !exts.iter().any(|ext| ext == "GL_EXT_texture_format_BGRA8888") {
return Err(GlesError::GLExtensionNotSupported(&[
"GL_EXT_texture_format_BGRA8888",
@ -1227,7 +1227,7 @@ impl ImportEgl for GlesRenderer {
format: match egl.format {
EGLFormat::RGB | EGLFormat::RGBA => Some(ffi::RGBA8),
EGLFormat::External => None,
_ => unreachable!("EGLBuffer currenly does not expose multi-planar buffers to us"),
_ => unreachable!("EGLBuffer currently does not expose multi-planar buffers to us"),
},
has_alpha: !matches!(egl.format, EGLFormat::RGB),
is_external: egl.format == EGLFormat::External,
@ -1887,7 +1887,7 @@ impl GlesRenderer {
/// Get access to the underlying [`EGLContext`].
///
/// *Note*: Modifying the context state, might result in rendering issues.
/// The context state is considerd an implementation detail
/// The context state is considered an implementation detail
/// and no guarantee is made about what can or cannot be changed.
/// To make sure a certain modification does not interfere with
/// the renderer's behaviour, check the source.
@ -2700,7 +2700,7 @@ impl GlesFrame<'_, '_> {
// dest position and scale
mat = mat * Matrix3::from_translation(Vector2::new(dest.loc.x as f32, dest.loc.y as f32));
// src scale, position, tranform and y_inverted
// src scale, position, transform and y_inverted
let tex_size = texture.size();
let src_size = src.size;
@ -3176,7 +3176,7 @@ impl GlesFrame<'_, '_> {
/// Get access to the underlying [`EGLContext`].
///
/// *Note*: Modifying the context state, might result in rendering issues.
/// The context state is considerd an implementation detail
/// The context state is considered an implementation detail
/// and no guarantee is made about what can or cannot be changed.
/// To make sure a certain modification does not interfere with
/// the renderer's behaviour, check the source.

View file

@ -9,7 +9,7 @@ use super::ffi;
/// When `tracy_gpu_profiling` feature is enabled, this wraps a Tracy span location.
/// When disabled, this is a zero-sized no-op type.
#[derive(Clone, Copy)]
#[allow(missing_debug_implementations)] // Tracy SpanLocation doens't impl Debug.
#[allow(missing_debug_implementations)] // Tracy SpanLocation doesn't impl Debug.
pub struct SpanLocation(#[cfg(feature = "tracy_gpu_profiling")] pub &'static tracy_client::SpanLocation);
/// Creates a GPU span location for profiling.

View file

@ -109,7 +109,7 @@ impl GlowRenderer {
/// Get access to the underlying [`EGLContext`].
///
/// *Note*: Modifying the context state, might result in rendering issues.
/// The context state is considerd an implementation detail
/// The context state is considered an implementation detail
/// and no guarantee is made about what can or cannot be changed.
/// To make sure a certain modification does not interfere with
/// the renderer's behaviour, check the source.

View file

@ -746,7 +746,7 @@ pub trait ExportMem: Renderer {
///
/// This function *may* fail, if:
/// - There is not enough space to create the mapping
/// - The texture does no allow copying for implementation-specfic reasons
/// - The texture does no allow copying for implementation-specific reasons
/// - It is not possible to convert the texture into the provided format.
fn copy_texture(
&mut self,
@ -762,7 +762,7 @@ pub trait ExportMem: Renderer {
/// method returns `true`.
///
/// This function *may* fail, if:
/// - A readability test did successfully complete (not that it returned `unreadble`!)
/// - A readability test did successfully complete (not that it returned `unreadable`!)
/// - Any of the state of the renderer is irrevesibly changed
fn can_read_texture(&mut self, texture: &Self::TextureId) -> Result<bool, Self::Error>;

View file

@ -24,7 +24,7 @@
//!
//! The `ImportMem`-implementation will upload the texture on the render-gpu, failing *if*
//! the render-gpu does not support the format as normal. Be careful when mixing gpu's
//! with different memory-formats supported, what formats you annouce.
//! with different memory-formats supported, what formats you announce.
//!
//! In contrast the `ImportDma`-implementations will transparently create copies
//! of client buffers, if necessary, given it is unclear if a dmabuf can be imported on any given gpu.
@ -283,9 +283,9 @@ impl<A: GraphicsApi> GpuManager<A> {
/// Create a [`MultiRenderer`].
///
/// - `render_device` should referr to the gpu node rendering operations will take place upon.
/// - `target_device` should referr to the gpu node the composited buffer will end up upon
/// - `allocator` should referr to an `Allocator`, that works guaranteed with the `render_device`
/// - `render_device` should refer to the gpu node rendering operations will take place upon.
/// - `target_device` should refer to the gpu node the composited buffer will end up upon
/// - `allocator` should refer to an `Allocator`, that works guaranteed with the `render_device`
/// to do offscreen composition on. Dma copies will be used, if buffers returned by the allocator
/// also work on the `target_device`.
/// - `copy_format` denotes the format buffers will be allocated in for offscreen rendering.
@ -354,9 +354,9 @@ impl<A: GraphicsApi> GpuManager<A> {
///
/// - `render_api` should be the [`GpuManager`] used for the `render_device`.
/// - `target_api` should be the [`GpuManager`] used for the `target_device`.
/// - `render_device` should referr to the gpu node rendering operations will take place upon.
/// - `target_device` should referr to the gpu node the composited buffer will end up upon
/// - `allocator` should referr to an `Allocator`, that works guaranteed with the `render_device`
/// - `render_device` should refer to the gpu node rendering operations will take place upon.
/// - `target_device` should refer to the gpu node the composited buffer will end up upon
/// - `allocator` should refer to an `Allocator`, that works guaranteed with the `render_device`
/// to do offscreen composition on. Dma copies will be used, if buffers returned by the allocator
/// also work on the `target_device`.
/// - `copy_format` denotes the format buffers will be allocated in for offscreen rendering.
@ -451,7 +451,7 @@ impl<A: GraphicsApi> GpuManager<A> {
/// If you are using [`MultiRenderer`]s do rendering of your client buffers,
/// you can call `early_import` on commit to start necessary copy processes early.
///
/// - `target` referrs to the gpu node, that the buffer needs to be accessable on later.
/// - `target` refers to the gpu node, that the buffer needs to be accessible on later.
/// *Note*: Usually this will be **render**ing gpu of a [`MultiRenderer`]
/// - `surface` is the wayland surface, whose buffer and subsurfaces buffers shall be imported
///
@ -688,7 +688,7 @@ impl<A: GraphicsApi> GpuManager<A> {
Ok(())
}
None => {
// welp, nothing we can do
// whelp, nothing we can do
Ok(())
}
}
@ -706,7 +706,7 @@ pub trait GraphicsApi {
/// - removing gone devices from list
/// - adding new devices to list
///
/// Existing devices are guranteed to be not recreated
/// Existing devices are guaranteed to be not recreated
fn enumerate(&self, list: &mut Vec<Self::Device>) -> Result<(), Self::Error>;
/// Method to force a re-enumeration, e.g. to free resources
fn needs_enumeration(&self) -> bool {
@ -1214,7 +1214,7 @@ where
});
let mut render_framebuffer = AliasableBox::from_unique(Box::new(render_framebuffer));
// We extend the lifetime to 'frame, because this is self-referencial.
// We extend the lifetime to 'frame, because this is self-referential.
// SAFETY:
// - We drop the framebuffer before `target`, which contains the referenced dmabuf
// - We drop the frame before the framebuffer as we store both in `MultiFrame`
@ -1365,7 +1365,7 @@ where
// (which takes ownership of the frame) or dropping the frame.
let render = unsafe { &mut *self.render };
// We extend the lifetime to 'frame, because this is self-referencial.
// We extend the lifetime to 'frame, because this is self-referential.
// SAFETY:
// - We drop the framebuffer before `target`, which contains the referenced dmabuf
// - We drop the frame before the framebuffer as we store both in `MultiFrame`
@ -1772,7 +1772,7 @@ impl MultiTexture {
.map(|(_, mappings)| mappings)
.unwrap_or_default();
// don't keep old mappings that are superseeded by new ones
// don't keep old mappings that are superseded by new ones
let format = tex.format;
let new_mappings = new_mappings
.filter(|(_, mapping)| {

View file

@ -81,7 +81,7 @@ impl LibSeatSession {
seat.map(|mut seat| {
let seat_name = seat.name().to_owned();
// In some cases enable_seat event is avalible right after startup
// In some cases enable_seat event is available right after startup
// so, we can dispatch it
seat.dispatch(0).unwrap();
let active = matches!(rx.try_recv(), Ok(SeatEvent::Enable));

View file

@ -521,7 +521,7 @@ impl PhysicalDevice {
/// [`vkGetPhysicalDeviceProperties2`]: https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceProperties2.html
pub unsafe fn get_properties(&self, props: &mut vk::PhysicalDeviceProperties2<'_>) {
let instance = self.instance().handle();
// SAFETY: The caller has garunteed all valid usage requirements for vkGetPhysicalDeviceProperties2
// SAFETY: The caller has guaranteed all valid usage requirements for vkGetPhysicalDeviceProperties2
// are satisfied.
unsafe { instance.get_physical_device_properties2(self.handle(), props) }
}
@ -538,7 +538,7 @@ impl PhysicalDevice {
/// [`vkGetPhysicalDeviceFormatProperties2`]: https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFormatProperties2.html
pub unsafe fn get_format_properties(&self, format: vk::Format, props: &mut vk::FormatProperties2<'_>) {
let instance = self.instance().handle();
// SAFETY: The caller has garunteed all valid usage requirements for vkGetPhysicalDeviceFormatProperties2
// SAFETY: The caller has guaranteed all valid usage requirements for vkGetPhysicalDeviceFormatProperties2
// are satisfied.
unsafe { instance.get_physical_device_format_properties2(self.handle(), format, props) }
}
@ -659,7 +659,7 @@ fn get_env_or_max_version(max_version: Version) -> Version {
// Consider max version overrides from env
match env::var("SMITHAY_VK_VERSION") {
Ok(version) => {
let overriden_version = match &version[..] {
let overridden_version = match &version[..] {
"1.0" => {
warn!("Smithay does not support Vulkan 1.0, ignoring SMITHAY_VK_VERSION");
return max_version;
@ -671,7 +671,7 @@ fn get_env_or_max_version(max_version: Version) -> Version {
};
// The env var can only lower the maximum version, not raise it.
if let Some(overridden_version) = overriden_version {
if let Some(overridden_version) = overridden_version {
if overridden_version > max_version {
warn!(
"Ignoring SMITHAY_VK_VERSION since the requested max version is higher than the maximum of {}.{}",

View file

@ -100,7 +100,7 @@ impl super::PhdInfo {
.iter()
.any(|name| name.as_c_str() == ext::physical_device_drm::NAME)
{
// SAFETY: The caller has garunteed the physical device supports VK_EXT_physical_device_drm
// SAFETY: The caller has guaranteed the physical device supports VK_EXT_physical_device_drm
let next = info
.properties_drm
.insert(vk::PhysicalDeviceDrmPropertiesEXT::default());

View file

@ -132,7 +132,7 @@ impl PointerAxisEvent<X11Input> for X11MouseWheelEvent {
}
fn source(&self) -> AxisSource {
// X11 seems to act within the scope of individual rachets of a scroll wheel.
// X11 seems to act within the scope of individual ratchets of a scroll wheel.
AxisSource::Wheel
}

View file

@ -383,7 +383,7 @@ impl X11Handle {
let mut modifiers = modifiers.collect::<Vec<_>>();
// older dri3 versions do only support buffers with one plane.
// we need to make sure, we don't accidently allocate buffers with more.
// we need to make sure, we don't accidentally allocate buffers with more.
if window.0.extensions.dri3 < Some((1, 2)) {
modifiers.retain(|modi| modi == &DrmModifier::Invalid || modi == &DrmModifier::Linear);
}

View file

@ -221,7 +221,7 @@ impl PopupGrabInner {
/// One example would be to use a timer to automatically dismiss the popup after some
/// timeout.
///
/// The grab is obtained by calling [`PopupManager::grap_popup`](super::PopupManager::grab_popup).
/// The grab is obtained by calling [`PopupManager::grab_popup`](super::PopupManager::grab_popup).
pub struct PopupGrab<D>
where
D: SeatHandler + 'static,

View file

@ -250,7 +250,7 @@ pub fn send_frames_surface_tree<T, F>(
if send_frame_callback {
// the surface may not have any user_data if it is a subsurface and has not
// yet been commited
// yet been committed
for callback in states
.cached_state
.get::<SurfaceAttributes>()

View file

@ -643,12 +643,12 @@ impl<D: SeatHandler + 'static> Seat<D> {
/// points are released again.
///
/// See [`Seat::add_touch`] for more information
pub fn add_touch_with_default_grab<F>(&mut self, defaut_grab: F) -> TouchHandle<D>
pub fn add_touch_with_default_grab<F>(&mut self, default_grab: F) -> TouchHandle<D>
where
F: Fn() -> Box<dyn TouchGrab<D>> + Send + 'static,
{
let mut inner = self.arc.inner.lock().unwrap();
let touch = TouchHandle::new(defaut_grab);
let touch = TouchHandle::new(default_grab);
if inner.touch.is_some() {
// If there's already a tocuh device, remove it notify the clients about the change.
inner.touch = None;

View file

@ -322,12 +322,12 @@ impl Output {
self.inner.0.lock().unwrap().transform
}
/// Returns the currenly set scale of the output
/// Returns the currently set scale of the output
pub fn current_scale(&self) -> Scale {
self.inner.0.lock().unwrap().scale
}
/// Returns the currenly advertised location of the output
/// Returns the currently advertised location of the output
pub fn current_location(&self) -> Point<i32, Logical> {
self.inner.0.lock().unwrap().location
}

View file

@ -84,7 +84,7 @@ impl Time<Monotonic> {
/// This should match timestamps from libinput:
/// <https://wayland.freedesktop.org/libinput/doc/latest/timestamps.html>
pub fn as_micros(&self) -> u64 {
// Assume monotonic clock (but not realitime) fits as microseconds in 64-bit
// Assume monotonic clock (but not realtime) fits as microseconds in 64-bit
debug_assert!(self.tp.tv_sec >= 0);
debug_assert!(self.tp.tv_nsec >= 0);
self.tp.tv_sec as u64 * 1000000 + self.tp.tv_nsec as u64 / 1000

View file

@ -1,6 +1,6 @@
// The caching logic is used to process surface synchronization. It creates
// an effective decoupling between the moment the client sends wl_surface.commit
// and the moment where the state that was commited is actually applied by the
// and the moment where the state that was committed is actually applied by the
// compositor.
//
// The way this is modelled in Smithay is through the `Cache` type, which is a container
@ -14,7 +14,7 @@
// the client requests
// - On commit, a snapshot of this pending state is created by invoking `Cacheable::commit`
// and stored in the cache alongside an externally provided id
// - When the compositor decices that a given state (represented by its commit id) should
// - When the compositor decides that a given state (represented by its commit id) should
// become active, `Cache::apply_state` is invoked with that commit id. The associated state
// is then applied to the `current` state, that the compositor can then use as a reference
// for the current window state. Note that, to preserve the commit ordering, all states

View file

@ -4,7 +4,7 @@
// pending states identified with numeric commit ids, allowing the compositor
// to precisely control *when* a state become active. This file is the second
// half: these identified states are grouped into transactions, which allow the
// synchronization of updates accross surfaces.
// synchronization of updates across surfaces.
//
// There are 2 main cases when the state of multiple surfaces must be updated
// atomically:
@ -15,7 +15,7 @@
// and are all applied atomically when the transaction itself is applied. The logic for creating
// new transactions is currently the following:
//
// - Each surface has an implicit "pending" transaction, into which its newly commited state is
// - Each surface has an implicit "pending" transaction, into which its newly committed state is
// recorded
// - Furthermore, on commit, the pending transaction of all synchronized child subsurfaces is merged
// into the current surface's pending transaction, and a new implicit transaction is started for those
@ -27,10 +27,10 @@
// of the wp_transaction protocol). Explicit synchronization introduces a notion of blockers: the transaction
// cannot be applied before all blockers are released, and thus must wait for it to be the case.
//
// For thoses situations, the (currently unused) `TransactionQueue` will come into play. It is a per-client
// For those situations, the (currently unused) `TransactionQueue` will come into play. It is a per-client
// queue of transactions, that stores and applies them by both respecting their topological order
// (ensuring that for each surface, states are applied in the correct order) and that all transactions
// wait befor all their blockers are resolved to be merged. If a blocker is cancelled, the whole transaction
// wait before all their blockers are resolved to be merged. If a blocker is cancelled, the whole transaction
// it blocks is cancelled as well, and simply dropped. Thanks to the logic of `Cache::apply_state`, the
// associated state will be applied automatically when the next valid transaction is applied, ensuring
// global coherence.
@ -300,7 +300,7 @@ impl TransactionQueue {
// manually iterate as we're going to modify the Vec while iterating on it
let mut i = 0;
// the loop will terminate, as at every iteration either i is incremented by 1
// or the lenght of self.transactions is reduced by 1.
// or the length of self.transactions is reduced by 1.
while i < self.transactions.len() {
let mut skip = false;
// does the transaction have any active blocker?

View file

@ -974,7 +974,7 @@ pub trait DmabufHandler: BufferHandler {
/// The `global` indicates which [`DmabufGlobal`] the buffer was imported to. You should import the dmabuf
/// into your renderer to ensure the dmabuf may be used later when rendering.
///
/// Whether dmabuf import succeded is notified through the [`ImportNotifier`] object provided in this function.
/// Whether dmabuf import succeeded is notified through the [`ImportNotifier`] object provided in this function.
fn dmabuf_imported(&mut self, global: &DmabufGlobal, dmabuf: Dmabuf, notifier: ImportNotifier);
/// This function allows to override the default [`DmabufFeedback`] for a surface

View file

@ -67,7 +67,7 @@ pub use sync_point::*;
/// Test if DRM device supports `syncobj_eventfd`.
// Similar to test used in Mutter
pub fn supports_syncobj_eventfd(device: &DrmDeviceFd) -> bool {
// Pass device as palceholder for eventfd as well, since `drm_ffi` requires
// Pass device as placeholder for eventfd as well, since `drm_ffi` requires
// a valid fd.
match drm_ffi::syncobj::eventfd(device.as_fd(), 0, 0, device.as_fd(), false) {
Ok(_) => unreachable!(),

View file

@ -68,7 +68,7 @@ impl InputMethodHandle {
}
}
/// Whether there's an acitve instance of input-method.
/// Whether there's an active instance of input-method.
pub(crate) fn has_instance(&self) -> bool {
self.inner.lock().unwrap().instance.is_some()
}

View file

@ -20,7 +20,7 @@ use super::{KeyboardShortcutsInhibitHandler, KeyboardShortcutsInhibitState};
/// User data of [ZwpKeyboardShortcutsInhibitorV1] object
#[derive(Debug)]
pub struct KeyboardShortcutsInhibitorUserData {
/// Seat that is beeing inhibited
/// Seat that is being inhibited
pub(crate) seat: ObjectId,
/// Surface that is inhibiting shortcuts
pub(crate) surface: WlSurface,

View file

@ -101,17 +101,17 @@ impl KeyboardShortcutsInhibitor {
self.data().is_active.store(v, atomic::Ordering::Release);
}
/// Seat that is beeing inhibited
/// Seat that is being inhibited
fn seat_id(&self) -> &SeatId {
&self.data().seat
}
/// Seat that is beeing inhibited
/// Seat that is being inhibited
pub fn seat(&self, dh: &DisplayHandle) -> Option<WlSeat> {
WlSeat::from_id(dh, self.seat_id().clone()).ok()
}
/// Seat that is beeing inhibited
/// Seat that is being inhibited
#[inline]
pub fn wl_surface(&self) -> &WlSurface {
&self.data().surface
@ -233,7 +233,7 @@ pub trait KeyboardShortcutsInhibitHandler {
/// You may also postpone activation based on your compositor specific policy.
fn new_inhibitor(&mut self, inhibitor: KeyboardShortcutsInhibitor) {}
/// Inhibitor got destoryed
/// Inhibitor got destroyed
fn inhibitor_destroyed(&mut self, inhibitor: KeyboardShortcutsInhibitor) {}
}

View file

@ -37,7 +37,7 @@ pub trait PointerConstraintsHandler: SeatHandler {
/// Use [`with_pointer_constraint`] to access the constraint.
fn new_constraint(&mut self, surface: &WlSurface, pointer: &PointerHandle<Self>);
/// The client holding a LockedPointer has commited a cursor position hint.
/// The client holding a LockedPointer has committed a cursor position hint.
///
/// This is emitted upon a surface commit if the cursor position hint has been updated.
///
@ -332,7 +332,7 @@ fn add_constraint<D: SeatHandler + PointerConstraintsHandler + 'static>(
if data.constraints.contains_key(pointer) {
pointer_constraints.post_error(
zwp_pointer_constraints_v1::Error::AlreadyConstrained,
"pointer constrait already exists for surface and seat",
"pointer constraint already exists for surface and seat",
);
} else {
data.constraints.insert(pointer.clone(), constraint);

View file

@ -169,7 +169,7 @@ pub fn serialize_pressed_keys(keys: impl Iterator<Item = Keycode>) -> Vec<u8> {
}
// WeakSeat doesn't implement `Hash`, but we don't expect a lot of seats anyway,
// so a vector with linear comparision is fine actually.
// so a vector with linear comparison is fine actually.
pub(crate) struct FocusDestroyHook<D: SeatHandler + 'static>(RefCell<Vec<(WeakSeat<D>, HookId)>>);
impl<D: SeatHandler + 'static> FocusDestroyHook<D> {

View file

@ -64,7 +64,7 @@ impl SecurityContextState {
/// Register new [WpSecurityContextManagerV1] global
///
/// Filter determines if what clients see the global. It *must* exclude clients
/// created through a security context for the protcol to be correct and secure.
/// created through a security context for the protocol to be correct and secure.
pub fn new<D, F>(display: &DisplayHandle, filter: F) -> Self
where
D: GlobalDispatch<WpSecurityContextManagerV1, SecurityContextGlobalData>,

View file

@ -113,7 +113,7 @@ pub trait DataDeviceHandler: Sized + SelectionHandler + WaylandDndGrabHandler {
/// [DataDeviceState] getter
fn data_device_state(&mut self) -> &mut DataDeviceState;
/// Action chooser for DnD negociation
/// Action chooser for DnD negotiation
fn action_choice(&mut self, available: WlDndAction, preferred: WlDndAction) -> WlDndAction {
default_action_chooser(available, preferred)
}
@ -579,13 +579,13 @@ impl DataDeviceState {
}
}
/// A simple action chooser for DnD negociation
/// A simple action chooser for DnD negotiation
///
/// If the preferred action is available, it'll pick it. Otherwise, it'll pick the first
/// available in the following order: Ask, Copy, Move.
pub fn default_action_chooser(available: WlDndAction, preferred: WlDndAction) -> WlDndAction {
// if the preferred action is valid (a single action) and in the available actions, use it
// otherwise, follow a fallback stategy
// otherwise, follow a fallback strategy
if [WlDndAction::Move, WlDndAction::Copy, WlDndAction::Ask].contains(&preferred)
&& available.contains(preferred)
{

View file

@ -172,7 +172,7 @@ pub struct LayerSurfaceCachedState {
pub size: Size<i32, Logical>,
/// Anchor bitflags, describing how the layers surface should be positioned and sized
pub anchor: Anchor,
/// Descripton of exclusive zone
/// Description of exclusive zone
pub exclusive_zone: ExclusiveZone,
/// Edge for exclusive zone
pub exclusive_edge: Option<Anchor>,

View file

@ -12,7 +12,7 @@ use wayland_server::WEnum;
/// Multiple surfaces can share a single layer, and ordering within a single layer is undefined.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Layer {
/// The lowest layer, used usualy for wallpapers
/// The lowest layer, used usually for wallpapers
Background,
/// The layer bellow the windows and above the wallpaper
Bottom,

View file

@ -117,8 +117,8 @@ where
let current = attributes.current_server_state();
attributes.server_pending = Some(current);
}
let current_capabilties = &mut attributes.server_pending.as_mut().unwrap().capabilities;
current_capabilties.replace(default_capabilities.capabilities.iter().copied());
let current_capabilities = &mut attributes.server_pending.as_mut().unwrap().capabilities;
current_capabilities.replace(default_capabilities.capabilities.iter().copied());
initial
});

View file

@ -1641,8 +1641,8 @@ impl ToplevelSurface {
// Don't forget to prepare the default capabilities though.
let default_capabilities = &state.xdg_shell_state().default_capabilities;
role.server_pending = Some(Default::default());
let current_capabilties = &mut role.server_pending.as_mut().unwrap().capabilities;
current_capabilties.replace(default_capabilities.capabilities.iter().copied());
let current_capabilities = &mut role.server_pending.as_mut().unwrap().capabilities;
current_capabilities.replace(default_capabilities.capabilities.iter().copied());
}
None

View file

@ -177,7 +177,7 @@ impl TabletTool {
// Unfocus previous surface
self.proximity_out(time);
// Focuss a new one
// Focus a new one
self.proximity_in(pos, focus, tablet, serial, time)
}
}

View file

@ -208,7 +208,7 @@ where
data.handle.increment_serial(resource);
}
// Discard requsets without any active input method instance.
// Discard requests without any active input method instance.
if !data.input_method_handle.has_instance() {
debug!("discarding text-input request without IME running");
return;

View file

@ -271,7 +271,7 @@ pub trait XdgActivationHandler {
);
}
/// Data assoicated with an activation token protocol object.
/// Data associated with an activation token protocol object.
#[derive(Debug)]
pub struct ActivationTokenData {
constructed: AtomicBool,

View file

@ -52,7 +52,7 @@ pub(crate) struct X11Lock {
impl X11Lock {
/// Try to grab a lockfile for given X display number
fn grab(number: u32) -> Result<X11Lock, ()> {
debug!(display = number, "Attempting to aquire an X11 display lock");
debug!(display = number, "Attempting to acquire an X11 display lock");
let filename = format!("/tmp/.X{number}-lock");
let lockfile = ::std::fs::OpenOptions::new()
.write(true)

View file

@ -341,7 +341,7 @@ pub trait XwmHandler {
///
/// To grant the wish you have to call `X11Surface::set_mapped(true)` for the window to become visible.
fn map_window_request(&mut self, xwm: XwmId, window: X11Surface);
/// Notification a window was mapped sucessfully
/// Notification a window was mapped successfully
fn map_window_notify(&mut self, xwm: XwmId, window: X11Surface) {
let _ = (xwm, window);
}
@ -519,10 +519,10 @@ pub enum ResizeEdge {
/// Errors generated working with Xwm Selections
#[derive(thiserror::Error, Debug)]
pub enum SelectionError {
/// X11 Error occured setting the selection
/// X11 Error occurred setting the selection
#[error(transparent)]
X11Error(#[from] ReplyOrIdError),
/// Calloop error occured trying to register transfer with event loop
/// Calloop error occurred trying to register transfer with event loop
#[error(transparent)]
Calloop(#[from] calloop::Error),
/// Unable to determine internal Atom for given mime-type
@ -540,7 +540,7 @@ impl From<ConnectionError> for SelectionError {
/// Errors generated updating XSETTINGS
#[derive(Debug, thiserror::Error)]
pub enum SettingsError {
/// X11 Error occured updating XSETTINGS
/// X11 Error occurred updating XSETTINGS
#[error(transparent)]
X11Error(#[from] ConnectionError),
/// A provided name isn't allowed
@ -557,7 +557,7 @@ pub enum SettingsError {
/// Errors generated updating the primary output
#[derive(Debug, thiserror::Error)]
pub enum PrimaryOutputError {
/// X11 Error occured updating xrandr primary output
/// X11 Error occurred updating xrandr primary output
#[error(transparent)]
X11Error(#[from] ReplyError),
/// The output was unknown to Xwayland

4
typos.toml Normal file
View file

@ -0,0 +1,4 @@
[default]
[default.extend-words]
WRONLY = "WRONLY"