Skip to content

Commit

Permalink
Remove unused fields
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisduerr committed May 6, 2024
1 parent edb0412 commit 429c027
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 16 deletions.
6 changes: 0 additions & 6 deletions src/catacomb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,11 @@ const PREDICTION_PADDING: Duration = Duration::from_millis(8);

/// Shared compositor state.
pub struct Catacomb {
pub suspend_timer: Option<RegistrationToken>,
pub idle_timer: Option<RegistrationToken>,
pub event_loop: LoopHandle<'static, Self>,
pub display_handle: DisplayHandle,
pub key_bindings: Vec<KeyBinding>,
pub touch_state: TouchState,
pub frame_pacer: FramePacer,
pub last_resume: Instant,
pub seat_name: String,
pub windows: Windows,
pub seat: Seat<Self>,
Expand Down Expand Up @@ -321,15 +318,12 @@ impl Catacomb {
backend,
seat,
accelerometer_token: accel_token,
last_resume: Instant::now(),
idle_inhibitors: Default::default(),
suspend_timer: Default::default(),
key_bindings: Default::default(),
ime_override: Default::default(),
frame_pacer: Default::default(),
last_focus: Default::default(),
terminated: Default::default(),
idle_timer: Default::default(),
sleeping: Default::default(),
stalled: Default::default(),
locker: Default::default(),
Expand Down
9 changes: 4 additions & 5 deletions src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ impl TouchState {
// Continue gesture if direction is locked in already.
match self.start.handle_direction {
Some(HandleDirection::Horizontal) => {
let delta = self.position.x - self.start.position.x;
return Some(HandleGesture::Horizontal(delta).into());
return Some(HandleGesture::Horizontal.into());
},
Some(HandleDirection::Vertical) => {
return Some(HandleGesture::Vertical(self.position.y).into());
Expand Down Expand Up @@ -247,7 +246,7 @@ pub enum HandleGesture {
/// Vertical position of the current touch point.
Vertical(f64),
/// Horizontal distance traveled as delta.
Horizontal(f64),
Horizontal,
}

impl HandleGesture {
Expand All @@ -269,7 +268,7 @@ impl HandleGesture {
if delta.y.abs() >= delta.x.abs() {
Some(HandleGesture::Vertical(end.y))
} else if Self::is_start(canvas, end) {
Some(HandleGesture::Horizontal(delta.x))
Some(HandleGesture::Horizontal)
} else {
None
}
Expand All @@ -293,7 +292,7 @@ enum HandleDirection {
impl From<&HandleGesture> for HandleDirection {
fn from(gesture: &HandleGesture) -> Self {
match gesture {
HandleGesture::Horizontal(_) => Self::Horizontal,
HandleGesture::Horizontal => Self::Horizontal,
HandleGesture::Vertical(_) => Self::Vertical,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/screencopy/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::protocols::screencopy::{ScreencopyHandler, ScreencopyManagerState};

pub struct ScreencopyFrameState {
pub rect: Rectangle<i32, Physical>,
pub overlay_cursor: bool,
pub _overlay_cursor: bool,
}

impl<D> Dispatch<ZwlrScreencopyFrameV1, ScreencopyFrameState, D> for ScreencopyManagerState
Expand Down
4 changes: 2 additions & 2 deletions src/protocols/screencopy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ where
};

// Create the frame.
let overlay_cursor = overlay_cursor != 0;
let frame = data_init.init(frame, ScreencopyFrameState { overlay_cursor, rect });
let _overlay_cursor = overlay_cursor != 0;
let frame = data_init.init(frame, ScreencopyFrameState { _overlay_cursor, rect });

// Send desired SHM buffer parameters.
frame.buffer(
Expand Down
4 changes: 2 additions & 2 deletions src/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ impl Windows {
let overview = Overview::new(self.layouts.active_offset(), primary_percentage);
self.set_view(View::Overview(overview));
},
(HandleGesture::Vertical(_) | HandleGesture::Horizontal(_), _) => (),
(HandleGesture::Vertical(_) | HandleGesture::Horizontal, _) => (),
}
}

Expand Down Expand Up @@ -1106,7 +1106,7 @@ impl Windows {
// Resize back to workspace size.
self.resize_visible();
},
(HandleGesture::Vertical(_) | HandleGesture::Horizontal(_), _) => (),
(HandleGesture::Vertical(_) | HandleGesture::Horizontal, _) => (),
}
}

Expand Down

0 comments on commit 429c027

Please sign in to comment.