made it compile without click

This commit is contained in:
maxstrb 2025-11-27 22:16:19 +01:00
parent f5c7071d89
commit 874c908c87
3 changed files with 10 additions and 9 deletions

View file

@ -38,8 +38,14 @@ fn main() {
let surface = compositor.create_surface(&qh);
let layer =
layer_shell.create_layer_surface(&qh, surface, Layer::Top, Some("simple_layer"), None);
let output_state = OutputState::new(&globals, &qh);
let layer = layer_shell.create_layer_surface(
&qh,
surface,
Layer::Top,
Some("simple_layer"),
output_state.outputs().nth(1).as_ref(),
);
layer.set_anchor(Anchor::TOP);
layer.set_exclusive_zone(-1);
layer.set_keyboard_interactivity(KeyboardInteractivity::OnDemand);
@ -52,7 +58,7 @@ fn main() {
let mut simple_layer = SimpleLayer::new(
RegistryState::new(&globals),
SeatState::new(&globals, &qh),
OutputState::new(&globals, &qh),
output_state,
shm,
pool,
256,

View file

@ -28,7 +28,6 @@ impl PointerHandler for SimpleLayer {
Motion { .. } => {}
Press { button, .. } => {
println!("Press {:x} @ {:?}", button, event.position);
self.shift = self.shift.xor(Some(0));
}
Release { button, .. } => {
println!("Release {:x} @ {:?}", button, event.position);

View file

@ -21,7 +21,7 @@ impl SimpleLayer {
// Draw to the window:
{
let shift = self.shift.unwrap_or(0);
let shift = 0;
canvas
.chunks_exact_mut(4)
.enumerate()
@ -38,10 +38,6 @@ impl SimpleLayer {
let array: &mut [u8; 4] = chunk.try_into().unwrap();
*array = color.to_le_bytes();
});
if let Some(shift) = &mut self.shift {
*shift = (*shift + 1) % width;
}
}
// Damage the entire window