Skip to content

Commit

Permalink
chore: Update smithay/libcosmic
Browse files Browse the repository at this point in the history
  • Loading branch information
Drakulix committed Mar 26, 2024
1 parent 3cff426 commit cf75bc1
Show file tree
Hide file tree
Showing 7 changed files with 207 additions and 170 deletions.
58 changes: 36 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ members = [
anyhow = {version = "1.0.51", features = ["backtrace"]}
bitflags = "2.4"
bytemuck = "1.12"
calloop = {version = "0.12.2", features = ["executor"]}
calloop = {version = "0.13.0", features = ["executor"]}
cosmic-comp-config = {path = "cosmic-comp-config"}
cosmic-config = {git = "https://github.com/pop-os/libcosmic/", features = ["calloop", "macro"]}
cosmic-protocols = {git = "https://github.com/pop-os/cosmic-protocols", branch = "main", default-features = false, features = ["server"]}
Expand Down Expand Up @@ -117,4 +117,4 @@ inherits = "release"
lto = "fat"

[patch."https://github.com/Smithay/smithay.git"]
smithay = {git = "https://github.com/smithay//smithay", rev = "c17297b"}
smithay = {git = "https://github.com/smithay//smithay", rev = "e5f0068"}
62 changes: 38 additions & 24 deletions src/input/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ use smithay::{
GestureSwipeBeginEvent, GestureSwipeEndEvent, GestureSwipeUpdateEvent, MotionEvent,
RelativeMotionEvent,
},
touch::{DownEvent, MotionEvent as TouchMotionEvent, UpEvent},
Seat, SeatState,
},
output::Output,
Expand Down Expand Up @@ -1313,19 +1314,18 @@ impl State {
let under = State::surface_under(position, &output, &mut self.common.shell)
.map(|(target, pos)| (target, pos.as_logical()));

if let Some((target, pos)) = under {
if let Some(wl_surface) = target.wl_surface() {
let serial = SERIAL_COUNTER.next_serial();
let touch = seat.get_touch().unwrap();
touch.down(
serial,
event.time_msec(),
&wl_surface,
position.as_logical() - pos.to_f64(),
event.slot(),
);
}
}
let serial = SERIAL_COUNTER.next_serial();
let touch = seat.get_touch().unwrap();
touch.down(
self,
under,
&DownEvent {
slot: event.slot(),
location: position.as_logical(),
serial,
time: event.time_msec(),
},
);
}
}
InputEvent::TouchMotion { event, .. } => {
Expand All @@ -1346,30 +1346,44 @@ impl State {
let under = State::surface_under(position, &output, &mut self.common.shell)
.map(|(target, pos)| (target, pos.as_logical()));

if let Some((_target, pos)) = under {
let touch = seat.get_touch().unwrap();
touch.motion(
event.time_msec(),
event.slot(),
position.as_logical() - pos.to_f64(),
);
}
let touch = seat.get_touch().unwrap();
touch.motion(
self,
under,
&TouchMotionEvent {
slot: event.slot(),
location: position.as_logical(),
time: event.time_msec(),
},
);
}
}
InputEvent::TouchUp { event, .. } => {
if let Some(seat) = self.common.seat_with_device(&event.device()) {
let serial = SERIAL_COUNTER.next_serial();
let touch = seat.get_touch().unwrap();
touch.up(serial, event.time_msec(), event.slot());
touch.up(
self,
&UpEvent {
slot: event.slot(),
time: event.time_msec(),
serial,
},
);
}
}
InputEvent::TouchCancel { event, .. } => {
if let Some(seat) = self.common.seat_with_device(&event.device()) {
let touch = seat.get_touch().unwrap();
touch.cancel();
touch.cancel(self);
}
}
InputEvent::TouchFrame { event, .. } => {
if let Some(seat) = self.common.seat_with_device(&event.device()) {
let touch = seat.get_touch().unwrap();
touch.frame(self);
}
}
InputEvent::TouchFrame { event: _, .. } => {}
InputEvent::TabletToolAxis { event, .. } => {
if let Some(seat) = self.common.seat_with_device(&event.device()).cloned() {
let Some(output) =
Expand Down
Loading

0 comments on commit cf75bc1

Please sign in to comment.