fix: clippy
This commit is contained in:
@@ -165,7 +165,7 @@ impl Wayland {
|
||||
let dh1 = display.handle();
|
||||
let mut dh2 = dh1.clone();
|
||||
|
||||
Ok(task::new(|| "wayland loop", async move {
|
||||
task::new(|| "wayland loop", async move {
|
||||
let _socket = socket; // Keep the socket alive
|
||||
loop {
|
||||
tokio::select! {
|
||||
@@ -191,7 +191,7 @@ impl Wayland {
|
||||
}
|
||||
}
|
||||
}
|
||||
})?)
|
||||
})
|
||||
}
|
||||
|
||||
#[instrument(level = "debug", name = "Wayland frame", skip(self))]
|
||||
|
||||
@@ -239,7 +239,7 @@ impl SeatWrapper {
|
||||
for key in keys {
|
||||
keyboard.input(
|
||||
&mut state.lock(),
|
||||
key.abs() as u32,
|
||||
key.unsigned_abs(),
|
||||
if key > 0 {
|
||||
KeyState::Pressed
|
||||
} else {
|
||||
|
||||
@@ -107,7 +107,7 @@ impl CoreSurface {
|
||||
)))
|
||||
});
|
||||
self.sk_mat.get_or_init(|| {
|
||||
let shader = Shader::from_memory(&PANEL_SHADER_BYTES).unwrap();
|
||||
let shader = Shader::from_memory(PANEL_SHADER_BYTES).unwrap();
|
||||
// let _ = renderer.with_context(|c| unsafe {
|
||||
// shader_inject(c, &mut shader, SIMULA_VERT_STR, SIMULA_FRAG_STR)
|
||||
// });
|
||||
|
||||
@@ -100,7 +100,7 @@ impl XdgShellHandler for WaylandState {
|
||||
toplevel.clone(),
|
||||
client_state.seat.clone(),
|
||||
)),
|
||||
client_state.pid.clone(),
|
||||
client_state.pid,
|
||||
);
|
||||
handle_cursor(&panel_item, panel_item.backend.seat.cursor_info_rx.clone());
|
||||
utils::insert_data(toplevel.wl_surface(), Arc::downgrade(&panel_item));
|
||||
@@ -430,14 +430,13 @@ impl Backend for XdgBackend {
|
||||
.clone()
|
||||
});
|
||||
let toplevel_cached_state = compositor::with_states(toplevel.wl_surface(), |states| {
|
||||
states.cached_state.current::<SurfaceCachedState>().clone()
|
||||
*states.cached_state.current::<SurfaceCachedState>()
|
||||
});
|
||||
let toplevel_core_surface = CoreSurface::from_wl_surface(toplevel.wl_surface()).unwrap();
|
||||
|
||||
let size = toplevel
|
||||
.current_state()
|
||||
.size
|
||||
.clone()
|
||||
.map(|s| Vector2::from([s.w as u32, s.h as u32]))
|
||||
.or_else(|| toplevel_core_surface.size())
|
||||
.unwrap_or(Vector2::from([0; 2]));
|
||||
@@ -571,7 +570,7 @@ impl Backend for XdgBackend {
|
||||
}
|
||||
|
||||
fn pointer_motion(&self, surface: &SurfaceId, position: Vector2<f32>) {
|
||||
let Some(surface) = self.wl_surface_from_id(&surface) else {
|
||||
let Some(surface) = self.wl_surface_from_id(surface) else {
|
||||
return;
|
||||
};
|
||||
self.seat.pointer_motion(surface, position)
|
||||
@@ -589,14 +588,14 @@ impl Backend for XdgBackend {
|
||||
}
|
||||
|
||||
fn keyboard_keys(&self, surface: &SurfaceId, keymap_id: u64, keys: Vec<i32>) {
|
||||
let Some(surface) = self.wl_surface_from_id(&surface) else {
|
||||
let Some(surface) = self.wl_surface_from_id(surface) else {
|
||||
return;
|
||||
};
|
||||
self.seat.keyboard_keys(surface, keymap_id, keys)
|
||||
}
|
||||
|
||||
fn touch_down(&self, surface: &SurfaceId, id: u32, position: Vector2<f32>) {
|
||||
let Some(surface) = self.wl_surface_from_id(&surface) else {
|
||||
let Some(surface) = self.wl_surface_from_id(surface) else {
|
||||
return;
|
||||
};
|
||||
self.seat.touch_down(surface, id, position)
|
||||
|
||||
Reference in New Issue
Block a user