Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/image_viewporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn main() {
window.set_app_id("io.github.smithay.client-toolkit.ImageViewer");
window.set_min_size(Some((256, 256)));
let path: &Path = path.as_os_str().as_ref();
window.set_title(path.components().last().unwrap().as_os_str().to_string_lossy());
window.set_title(path.components().next_back().unwrap().as_os_str().to_string_lossy());

// In order for the window to be mapped, we need to perform an initial commit with no attached buffer.
// For more info, see WaylandSurface::commit
Expand Down
2 changes: 1 addition & 1 deletion src/compositor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ impl wayland_client::backend::ObjectData for RegionData {
self: Arc<Self>,
_: &wayland_client::backend::Backend,
_: wayland_client::backend::protocol::Message<wayland_client::backend::ObjectId, OwnedFd>,
) -> Option<Arc<(dyn wayland_client::backend::ObjectData + 'static)>> {
) -> Option<Arc<dyn wayland_client::backend::ObjectData + 'static>> {
unreachable!("wl_region has no events");
}
fn destroyed(&self, _: wayland_client::backend::ObjectId) {}
Expand Down
2 changes: 1 addition & 1 deletion src/data_device_manager/write_pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl AsRawFd for WritePipe {

#[cfg(feature = "calloop")]
impl AsFd for WritePipe {
fn as_fd(&self) -> BorrowedFd {
fn as_fd(&self) -> BorrowedFd<'_> {
self.file.get_ref().as_fd()
}
}
Expand Down
19 changes: 10 additions & 9 deletions src/seat/input_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,18 @@ pub struct SurroundingText {
}

/// State machine for determining the capabilities of a text input
#[derive(Clone, Debug, Copy, PartialEq)]
#[derive(Clone, Debug, Default, Copy, PartialEq)]
pub enum Active {
#[default]
Inactive,
NegotiatingCapabilities { surrounding_text: bool, content_type: bool },
Active { surrounding_text: bool, content_type: bool },
}

impl Default for Active {
fn default() -> Self {
Self::Inactive
}
NegotiatingCapabilities {
surrounding_text: bool,
content_type: bool,
},
Active {
surrounding_text: bool,
content_type: bool,
},
}

impl Active {
Expand Down
19 changes: 10 additions & 9 deletions src/seat/input_method_v3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,17 +342,18 @@ pub struct SurroundingText {
}

/// State machine for determining the capabilities of a text input
#[derive(Clone, Debug, Copy, PartialEq)]
#[derive(Clone, Debug, Default, Copy, PartialEq)]
pub enum Active {
#[default]
Inactive,
NegotiatingCapabilities { surrounding_text: bool, content_type: bool },
Active { surrounding_text: bool, content_type: bool },
}

impl Default for Active {
fn default() -> Self {
Self::Inactive
}
NegotiatingCapabilities {
surrounding_text: bool,
content_type: bool,
},
Active {
surrounding_text: bool,
content_type: bool,
},
}

impl Active {
Expand Down
19 changes: 12 additions & 7 deletions src/seat/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::{
fmt::{self, Display, Formatter},
slice,
sync::{
atomic::{AtomicBool, Ordering},
Arc, Mutex,
Expand Down Expand Up @@ -250,14 +251,18 @@ impl SeatState {
if let CursorShapeManagerState::Pending { registry, global } =
&self.cursor_shape_manager_state
{
self.cursor_shape_manager_state =
match crate::registry::bind_one(registry, &[global.clone()], qh, 1..=2, GlobalData)
{
Ok(bound) => {
CursorShapeManagerState::Bound(CursorShapeManager::from_existing(bound))
}
Err(_) => CursorShapeManagerState::NotPresent,
self.cursor_shape_manager_state = match crate::registry::bind_one(
registry,
slice::from_ref(global),
qh,
1..=2,
GlobalData,
) {
Ok(bound) => {
CursorShapeManagerState::Bound(CursorShapeManager::from_existing(bound))
}
Err(_) => CursorShapeManagerState::NotPresent,
}
}

let shape_device =
Expand Down
9 changes: 2 additions & 7 deletions src/seat/pointer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ impl<U, S> Drop for ThemedPointer<U, S> {
}

/// Specifies which cursor theme should be used by the theme manager.
#[derive(Debug)]
#[derive(Debug, Default)]
pub enum ThemeSpec<'a> {
/// Use this specific theme with the given base size.
Named {
Expand All @@ -640,15 +640,10 @@ pub enum ThemeSpec<'a> {
/// In this case SCTK will read the `XCURSOR_THEME` and
/// `XCURSOR_SIZE` environment variables to figure out the
/// theme to use.
#[default]
System,
}

impl Default for ThemeSpec<'_> {
fn default() -> Self {
Self::System
}
}

/// An error indicating that the cursor was not found.
#[derive(Debug, thiserror::Error)]
pub enum PointerThemeError {
Expand Down
9 changes: 2 additions & 7 deletions src/shell/wlr_layer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,12 @@ pub enum SurfaceKind {
}

#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum KeyboardInteractivity {
/// No keyboard focus is possible.
///
/// This is the default value for all newly created layer shells.
#[default]
None,

/// Request exclusive keyboard focus if the layer is above shell surfaces.
Expand All @@ -204,12 +205,6 @@ pub enum KeyboardInteractivity {
OnDemand,
}

impl Default for KeyboardInteractivity {
fn default() -> Self {
Self::None
}
}

/// The z-depth of a layer.
///
/// These values indicate which order in which layer surfaces are rendered.
Expand Down
2 changes: 1 addition & 1 deletion src/shell/xdg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl wayland_client::backend::ObjectData for PositionerData {
self: Arc<Self>,
_: &wayland_client::backend::Backend,
_: wayland_client::backend::protocol::Message<wayland_client::backend::ObjectId, OwnedFd>,
) -> Option<Arc<(dyn wayland_client::backend::ObjectData + 'static)>> {
) -> Option<Arc<dyn wayland_client::backend::ObjectData + 'static>> {
unreachable!("xdg_positioner has no events");
}
fn destroyed(&self, _: wayland_client::backend::ObjectId) {}
Expand Down
4 changes: 2 additions & 2 deletions src/shm/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl RawPool {
}

impl AsFd for RawPool {
fn as_fd(&self) -> BorrowedFd {
fn as_fd(&self) -> BorrowedFd<'_> {
self.mem_file.as_fd()
}
}
Expand Down Expand Up @@ -283,7 +283,7 @@ impl ObjectData for ShmPoolData {
self: Arc<Self>,
_: &wayland_client::backend::Backend,
_: wayland_client::backend::protocol::Message<wayland_client::backend::ObjectId, OwnedFd>,
) -> Option<Arc<(dyn ObjectData + 'static)>> {
) -> Option<Arc<dyn ObjectData + 'static>> {
unreachable!("wl_shm_pool has no events")
}

Expand Down
Loading