chore: Update smithay/libcosmic
This commit is contained in:
parent
3cff426805
commit
cf75bc1952
7 changed files with 207 additions and 170 deletions
58
Cargo.lock
generated
58
Cargo.lock
generated
|
|
@ -547,6 +547,20 @@ name = "calloop"
|
|||
version = "0.12.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298"
|
||||
dependencies = [
|
||||
"bitflags 2.4.2",
|
||||
"log",
|
||||
"polling 3.3.2",
|
||||
"rustix 0.38.30",
|
||||
"slab",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "calloop"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec"
|
||||
dependencies = [
|
||||
"async-task",
|
||||
"bitflags 2.4.2",
|
||||
|
|
@ -563,7 +577,7 @@ version = "0.2.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02"
|
||||
dependencies = [
|
||||
"calloop",
|
||||
"calloop 0.12.4",
|
||||
"rustix 0.38.30",
|
||||
"wayland-backend",
|
||||
"wayland-client",
|
||||
|
|
@ -827,7 +841,7 @@ dependencies = [
|
|||
"anyhow",
|
||||
"bitflags 2.4.2",
|
||||
"bytemuck",
|
||||
"calloop",
|
||||
"calloop 0.13.0",
|
||||
"cosmic-comp-config",
|
||||
"cosmic-config",
|
||||
"cosmic-protocols",
|
||||
|
|
@ -887,10 +901,10 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-config"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#d02a4fefff319a3bd20936f9be30c4913bf49bab"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#cc439b2ceaf41226ab86416ae0ad3651c9a6e10a"
|
||||
dependencies = [
|
||||
"atomicwrites",
|
||||
"calloop",
|
||||
"calloop 0.13.0",
|
||||
"cosmic-config-derive",
|
||||
"dirs",
|
||||
"iced_futures",
|
||||
|
|
@ -905,7 +919,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-config-derive"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#d02a4fefff319a3bd20936f9be30c4913bf49bab"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#cc439b2ceaf41226ab86416ae0ad3651c9a6e10a"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
|
|
@ -926,7 +940,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-text"
|
||||
version = "0.11.2"
|
||||
source = "git+https://github.com/pop-os/cosmic-text.git#b08676909f882f553ab574601b35b58276a52458"
|
||||
source = "git+https://github.com/pop-os/cosmic-text.git#ff5501d9a36e51c50d908413caf7632d8f7533b7"
|
||||
dependencies = [
|
||||
"bitflags 2.4.2",
|
||||
"fontdb",
|
||||
|
|
@ -948,7 +962,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-theme"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#d02a4fefff319a3bd20936f9be30c4913bf49bab"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#cc439b2ceaf41226ab86416ae0ad3651c9a6e10a"
|
||||
dependencies = [
|
||||
"almost",
|
||||
"cosmic-config",
|
||||
|
|
@ -2296,7 +2310,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#d02a4fefff319a3bd20936f9be30c4913bf49bab"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#cc439b2ceaf41226ab86416ae0ad3651c9a6e10a"
|
||||
dependencies = [
|
||||
"iced_core",
|
||||
"iced_futures",
|
||||
|
|
@ -2310,7 +2324,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_core"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#d02a4fefff319a3bd20936f9be30c4913bf49bab"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#cc439b2ceaf41226ab86416ae0ad3651c9a6e10a"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"log",
|
||||
|
|
@ -2328,7 +2342,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_futures"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#d02a4fefff319a3bd20936f9be30c4913bf49bab"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#cc439b2ceaf41226ab86416ae0ad3651c9a6e10a"
|
||||
dependencies = [
|
||||
"futures",
|
||||
"iced_core",
|
||||
|
|
@ -2340,7 +2354,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_graphics"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#d02a4fefff319a3bd20936f9be30c4913bf49bab"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#cc439b2ceaf41226ab86416ae0ad3651c9a6e10a"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"bytemuck",
|
||||
|
|
@ -2364,7 +2378,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_renderer"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#d02a4fefff319a3bd20936f9be30c4913bf49bab"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#cc439b2ceaf41226ab86416ae0ad3651c9a6e10a"
|
||||
dependencies = [
|
||||
"iced_graphics",
|
||||
"iced_tiny_skia",
|
||||
|
|
@ -2376,7 +2390,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_runtime"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#d02a4fefff319a3bd20936f9be30c4913bf49bab"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#cc439b2ceaf41226ab86416ae0ad3651c9a6e10a"
|
||||
dependencies = [
|
||||
"iced_core",
|
||||
"iced_futures",
|
||||
|
|
@ -2387,7 +2401,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_style"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#d02a4fefff319a3bd20936f9be30c4913bf49bab"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#cc439b2ceaf41226ab86416ae0ad3651c9a6e10a"
|
||||
dependencies = [
|
||||
"iced_core",
|
||||
"once_cell",
|
||||
|
|
@ -2397,7 +2411,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_tiny_skia"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#d02a4fefff319a3bd20936f9be30c4913bf49bab"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#cc439b2ceaf41226ab86416ae0ad3651c9a6e10a"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"cosmic-text",
|
||||
|
|
@ -2414,7 +2428,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_wgpu"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#d02a4fefff319a3bd20936f9be30c4913bf49bab"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#cc439b2ceaf41226ab86416ae0ad3651c9a6e10a"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"bytemuck",
|
||||
|
|
@ -2433,7 +2447,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_widget"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#d02a4fefff319a3bd20936f9be30c4913bf49bab"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#cc439b2ceaf41226ab86416ae0ad3651c9a6e10a"
|
||||
dependencies = [
|
||||
"iced_renderer",
|
||||
"iced_runtime",
|
||||
|
|
@ -2763,7 +2777,7 @@ checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7"
|
|||
[[package]]
|
||||
name = "libcosmic"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#d02a4fefff319a3bd20936f9be30c4913bf49bab"
|
||||
source = "git+https://github.com/pop-os/libcosmic/#cc439b2ceaf41226ab86416ae0ad3651c9a6e10a"
|
||||
dependencies = [
|
||||
"apply",
|
||||
"chrono",
|
||||
|
|
@ -4491,12 +4505,12 @@ checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7"
|
|||
[[package]]
|
||||
name = "smithay"
|
||||
version = "0.3.0"
|
||||
source = "git+https://github.com/smithay//smithay?rev=c17297b#c17297b68e8bc761ebddf6900926d78b19a5d8d1"
|
||||
source = "git+https://github.com/smithay//smithay?rev=e5f0068#e5f006818df7ebb92d206985f45e713ba1e9c1c9"
|
||||
dependencies = [
|
||||
"appendlist",
|
||||
"ash",
|
||||
"bitflags 2.4.2",
|
||||
"calloop",
|
||||
"calloop 0.13.0",
|
||||
"cc",
|
||||
"cgmath",
|
||||
"cursor-icon",
|
||||
|
|
@ -4546,7 +4560,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "60e3d9941fa3bacf7c2bf4b065304faa14164151254cd16ce1b1bc8fc381600f"
|
||||
dependencies = [
|
||||
"bitflags 2.4.2",
|
||||
"calloop",
|
||||
"calloop 0.12.4",
|
||||
"calloop-wayland-source",
|
||||
"cursor-icon",
|
||||
"libc",
|
||||
|
|
@ -6033,7 +6047,7 @@ dependencies = [
|
|||
"atomic-waker",
|
||||
"bitflags 2.4.2",
|
||||
"bytemuck",
|
||||
"calloop",
|
||||
"calloop 0.12.4",
|
||||
"cfg_aliases 0.1.1",
|
||||
"core-foundation",
|
||||
"core-graphics",
|
||||
|
|
|
|||
|
|
@ -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"]}
|
||||
|
|
@ -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"}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ use smithay::{
|
|||
GestureSwipeBeginEvent, GestureSwipeEndEvent, GestureSwipeUpdateEvent, MotionEvent,
|
||||
RelativeMotionEvent,
|
||||
},
|
||||
touch::{DownEvent, MotionEvent as TouchMotionEvent, UpEvent},
|
||||
Seat, SeatState,
|
||||
},
|
||||
output::Output,
|
||||
|
|
@ -1313,21 +1314,20 @@ 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(
|
||||
self,
|
||||
under,
|
||||
&DownEvent {
|
||||
slot: event.slot(),
|
||||
location: position.as_logical(),
|
||||
serial,
|
||||
event.time_msec(),
|
||||
&wl_surface,
|
||||
position.as_logical() - pos.to_f64(),
|
||||
event.slot(),
|
||||
time: event.time_msec(),
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
InputEvent::TouchMotion { event, .. } => {
|
||||
if let Some(seat) = self.common.seat_with_device(&event.device()).cloned() {
|
||||
let Some(output) =
|
||||
|
|
@ -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(),
|
||||
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) =
|
||||
|
|
|
|||
|
|
@ -18,12 +18,6 @@ use smithay::{
|
|||
},
|
||||
input::{
|
||||
keyboard::{KeyboardTarget, KeysymHandle, ModifiersState},
|
||||
pointer::{
|
||||
AxisFrame, ButtonEvent, GestureHoldBeginEvent, GestureHoldEndEvent,
|
||||
GesturePinchBeginEvent, GesturePinchEndEvent, GesturePinchUpdateEvent,
|
||||
GestureSwipeBeginEvent, GestureSwipeEndEvent, GestureSwipeUpdateEvent, MotionEvent,
|
||||
PointerTarget, RelativeMotionEvent,
|
||||
},
|
||||
Seat,
|
||||
},
|
||||
output::Output,
|
||||
|
|
@ -670,11 +664,22 @@ impl KeyboardTarget<State> for CosmicSurface {
|
|||
if self.0.is_x11() {
|
||||
keys = vec![];
|
||||
}
|
||||
KeyboardTarget::enter(&self.0, seat, data, keys, serial)
|
||||
|
||||
match self.0.underlying_surface() {
|
||||
WindowSurface::Wayland(toplevel) => {
|
||||
KeyboardTarget::enter(toplevel.wl_surface(), seat, data, keys, serial)
|
||||
}
|
||||
WindowSurface::X11(x11) => KeyboardTarget::enter(x11, seat, data, keys, serial),
|
||||
}
|
||||
}
|
||||
|
||||
fn leave(&self, seat: &Seat<State>, data: &mut State, serial: smithay::utils::Serial) {
|
||||
KeyboardTarget::leave(&self.0, seat, data, serial)
|
||||
match self.0.underlying_surface() {
|
||||
WindowSurface::Wayland(toplevel) => {
|
||||
KeyboardTarget::leave(toplevel.wl_surface(), seat, data, serial)
|
||||
}
|
||||
WindowSurface::X11(x11) => KeyboardTarget::leave(x11, seat, data, serial),
|
||||
}
|
||||
}
|
||||
|
||||
fn key(
|
||||
|
|
@ -686,7 +691,14 @@ impl KeyboardTarget<State> for CosmicSurface {
|
|||
serial: smithay::utils::Serial,
|
||||
time: u32,
|
||||
) {
|
||||
KeyboardTarget::key(&self.0, seat, data, key, state, serial, time)
|
||||
match self.0.underlying_surface() {
|
||||
WindowSurface::Wayland(toplevel) => {
|
||||
KeyboardTarget::key(toplevel.wl_surface(), seat, data, key, state, serial, time)
|
||||
}
|
||||
WindowSurface::X11(x11) => {
|
||||
KeyboardTarget::key(x11, seat, data, key, state, serial, time)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn modifiers(
|
||||
|
|
@ -696,110 +708,14 @@ impl KeyboardTarget<State> for CosmicSurface {
|
|||
modifiers: ModifiersState,
|
||||
serial: smithay::utils::Serial,
|
||||
) {
|
||||
KeyboardTarget::modifiers(&self.0, seat, data, modifiers, serial)
|
||||
match self.0.underlying_surface() {
|
||||
WindowSurface::Wayland(toplevel) => {
|
||||
KeyboardTarget::modifiers(toplevel.wl_surface(), seat, data, modifiers, serial)
|
||||
}
|
||||
WindowSurface::X11(x11) => {
|
||||
KeyboardTarget::modifiers(x11, seat, data, modifiers, serial)
|
||||
}
|
||||
}
|
||||
|
||||
impl PointerTarget<State> for CosmicSurface {
|
||||
fn enter(&self, seat: &Seat<State>, data: &mut State, event: &MotionEvent) {
|
||||
PointerTarget::enter(&self.0, seat, data, event)
|
||||
}
|
||||
|
||||
fn motion(&self, seat: &Seat<State>, data: &mut State, event: &MotionEvent) {
|
||||
PointerTarget::motion(&self.0, seat, data, event)
|
||||
}
|
||||
|
||||
fn relative_motion(&self, seat: &Seat<State>, data: &mut State, event: &RelativeMotionEvent) {
|
||||
PointerTarget::relative_motion(&self.0, seat, data, event)
|
||||
}
|
||||
|
||||
fn button(&self, seat: &Seat<State>, data: &mut State, event: &ButtonEvent) {
|
||||
PointerTarget::button(&self.0, seat, data, event)
|
||||
}
|
||||
|
||||
fn axis(&self, seat: &Seat<State>, data: &mut State, frame: AxisFrame) {
|
||||
PointerTarget::axis(&self.0, seat, data, frame)
|
||||
}
|
||||
|
||||
fn frame(&self, seat: &Seat<State>, data: &mut State) {
|
||||
PointerTarget::frame(&self.0, seat, data)
|
||||
}
|
||||
|
||||
fn leave(
|
||||
&self,
|
||||
seat: &Seat<State>,
|
||||
data: &mut State,
|
||||
serial: smithay::utils::Serial,
|
||||
time: u32,
|
||||
) {
|
||||
PointerTarget::leave(&self.0, seat, data, serial, time)
|
||||
}
|
||||
|
||||
fn gesture_swipe_begin(
|
||||
&self,
|
||||
seat: &Seat<State>,
|
||||
data: &mut State,
|
||||
event: &GestureSwipeBeginEvent,
|
||||
) {
|
||||
PointerTarget::gesture_swipe_begin(&self.0, seat, data, event)
|
||||
}
|
||||
|
||||
fn gesture_swipe_update(
|
||||
&self,
|
||||
seat: &Seat<State>,
|
||||
data: &mut State,
|
||||
event: &GestureSwipeUpdateEvent,
|
||||
) {
|
||||
PointerTarget::gesture_swipe_update(&self.0, seat, data, event)
|
||||
}
|
||||
|
||||
fn gesture_swipe_end(
|
||||
&self,
|
||||
seat: &Seat<State>,
|
||||
data: &mut State,
|
||||
event: &GestureSwipeEndEvent,
|
||||
) {
|
||||
PointerTarget::gesture_swipe_end(&self.0, seat, data, event)
|
||||
}
|
||||
|
||||
fn gesture_pinch_begin(
|
||||
&self,
|
||||
seat: &Seat<State>,
|
||||
data: &mut State,
|
||||
event: &GesturePinchBeginEvent,
|
||||
) {
|
||||
PointerTarget::gesture_pinch_begin(&self.0, seat, data, event)
|
||||
}
|
||||
|
||||
fn gesture_pinch_update(
|
||||
&self,
|
||||
seat: &Seat<State>,
|
||||
data: &mut State,
|
||||
event: &GesturePinchUpdateEvent,
|
||||
) {
|
||||
PointerTarget::gesture_pinch_update(&self.0, seat, data, event)
|
||||
}
|
||||
|
||||
fn gesture_pinch_end(
|
||||
&self,
|
||||
seat: &Seat<State>,
|
||||
data: &mut State,
|
||||
event: &GesturePinchEndEvent,
|
||||
) {
|
||||
PointerTarget::gesture_pinch_end(&self.0, seat, data, event)
|
||||
}
|
||||
|
||||
fn gesture_hold_begin(
|
||||
&self,
|
||||
seat: &Seat<State>,
|
||||
data: &mut State,
|
||||
event: &GestureHoldBeginEvent,
|
||||
) {
|
||||
PointerTarget::gesture_hold_begin(&self.0, seat, data, event)
|
||||
}
|
||||
|
||||
fn gesture_hold_end(&self, seat: &Seat<State>, data: &mut State, event: &GestureHoldEndEvent) {
|
||||
PointerTarget::gesture_hold_end(&self.0, seat, data, event)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,12 @@ use smithay::{
|
|||
pointer::{
|
||||
AxisFrame, ButtonEvent, GestureHoldBeginEvent, GestureHoldEndEvent,
|
||||
GesturePinchBeginEvent, GesturePinchEndEvent, GesturePinchUpdateEvent,
|
||||
GestureSwipeBeginEvent, GestureSwipeEndEvent, GestureSwipeUpdateEvent, MotionEvent,
|
||||
PointerTarget, RelativeMotionEvent,
|
||||
GestureSwipeBeginEvent, GestureSwipeEndEvent, GestureSwipeUpdateEvent,
|
||||
MotionEvent as PointerMotionEvent, PointerTarget, RelativeMotionEvent,
|
||||
},
|
||||
touch::{
|
||||
DownEvent, MotionEvent as TouchMotionEvent, OrientationEvent, ShapeEvent, TouchTarget,
|
||||
UpEvent,
|
||||
},
|
||||
Seat,
|
||||
},
|
||||
|
|
@ -205,7 +209,7 @@ impl IsAlive for KeyboardFocusTarget {
|
|||
}
|
||||
|
||||
impl PointerTarget<State> for PointerFocusTarget {
|
||||
fn enter(&self, seat: &Seat<State>, data: &mut State, event: &MotionEvent) {
|
||||
fn enter(&self, seat: &Seat<State>, data: &mut State, event: &PointerMotionEvent) {
|
||||
if let Some(element) = self.toplevel(data) {
|
||||
for session in element.cursor_sessions() {
|
||||
session.set_cursor_pos(Some(
|
||||
|
|
@ -233,7 +237,7 @@ impl PointerTarget<State> for PointerFocusTarget {
|
|||
PointerFocusTarget::ResizeFork(f) => PointerTarget::enter(f, seat, data, event),
|
||||
}
|
||||
}
|
||||
fn motion(&self, seat: &Seat<State>, data: &mut State, event: &MotionEvent) {
|
||||
fn motion(&self, seat: &Seat<State>, data: &mut State, event: &PointerMotionEvent) {
|
||||
if let Some(element) = self.toplevel(data) {
|
||||
for session in element.cursor_sessions() {
|
||||
session.set_cursor_pos(Some(
|
||||
|
|
@ -483,6 +487,92 @@ impl PointerTarget<State> for PointerFocusTarget {
|
|||
}
|
||||
}
|
||||
|
||||
impl TouchTarget<State> for PointerFocusTarget {
|
||||
fn down(&self, seat: &Seat<State>, data: &mut State, event: &DownEvent, seq: Serial) {
|
||||
match self {
|
||||
PointerFocusTarget::WlSurface { surface, .. } => {
|
||||
TouchTarget::down(surface, seat, data, event, seq)
|
||||
}
|
||||
// TODO: implement TouchTarget for iced/CosmicWindow/CosmicStack/ResizeFork/Grabs
|
||||
PointerFocusTarget::WindowUI(_window) => {}
|
||||
PointerFocusTarget::StackUI(_stack) => {}
|
||||
PointerFocusTarget::ResizeFork(_fork) => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn up(&self, seat: &Seat<State>, data: &mut State, event: &UpEvent, seq: Serial) {
|
||||
match self {
|
||||
PointerFocusTarget::WlSurface { surface, .. } => {
|
||||
TouchTarget::up(surface, seat, data, event, seq)
|
||||
}
|
||||
PointerFocusTarget::WindowUI(_window) => {}
|
||||
PointerFocusTarget::StackUI(_stack) => {}
|
||||
PointerFocusTarget::ResizeFork(_fork) => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn motion(&self, seat: &Seat<State>, data: &mut State, event: &TouchMotionEvent, seq: Serial) {
|
||||
match self {
|
||||
PointerFocusTarget::WlSurface { surface, .. } => {
|
||||
TouchTarget::motion(surface, seat, data, event, seq)
|
||||
}
|
||||
PointerFocusTarget::WindowUI(_window) => {}
|
||||
PointerFocusTarget::StackUI(_stack) => {}
|
||||
PointerFocusTarget::ResizeFork(_fork) => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn frame(&self, seat: &Seat<State>, data: &mut State, seq: Serial) {
|
||||
match self {
|
||||
PointerFocusTarget::WlSurface { surface, .. } => {
|
||||
TouchTarget::frame(surface, seat, data, seq)
|
||||
}
|
||||
PointerFocusTarget::WindowUI(_window) => {}
|
||||
PointerFocusTarget::StackUI(_stack) => {}
|
||||
PointerFocusTarget::ResizeFork(_fork) => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn cancel(&self, seat: &Seat<State>, data: &mut State, seq: Serial) {
|
||||
match self {
|
||||
PointerFocusTarget::WlSurface { surface, .. } => {
|
||||
TouchTarget::cancel(surface, seat, data, seq)
|
||||
}
|
||||
PointerFocusTarget::WindowUI(_window) => {}
|
||||
PointerFocusTarget::StackUI(_stack) => {}
|
||||
PointerFocusTarget::ResizeFork(_fork) => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn shape(&self, seat: &Seat<State>, data: &mut State, event: &ShapeEvent, seq: Serial) {
|
||||
match self {
|
||||
PointerFocusTarget::WlSurface { surface, .. } => {
|
||||
TouchTarget::shape(surface, seat, data, event, seq)
|
||||
}
|
||||
PointerFocusTarget::WindowUI(_window) => {}
|
||||
PointerFocusTarget::StackUI(_stack) => {}
|
||||
PointerFocusTarget::ResizeFork(_fork) => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn orientation(
|
||||
&self,
|
||||
seat: &Seat<State>,
|
||||
data: &mut State,
|
||||
event: &OrientationEvent,
|
||||
seq: Serial,
|
||||
) {
|
||||
match self {
|
||||
PointerFocusTarget::WlSurface { surface, .. } => {
|
||||
TouchTarget::orientation(surface, seat, data, event, seq)
|
||||
}
|
||||
PointerFocusTarget::WindowUI(_window) => {}
|
||||
PointerFocusTarget::StackUI(_stack) => {}
|
||||
PointerFocusTarget::ResizeFork(_fork) => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl KeyboardTarget<State> for KeyboardFocusTarget {
|
||||
fn enter(
|
||||
&self,
|
||||
|
|
@ -498,7 +588,7 @@ impl KeyboardTarget<State> for KeyboardFocusTarget {
|
|||
}
|
||||
KeyboardFocusTarget::Group(_) => {}
|
||||
KeyboardFocusTarget::LayerSurface(l) => {
|
||||
KeyboardTarget::enter(l, seat, data, keys, serial)
|
||||
KeyboardTarget::enter(l.wl_surface(), seat, data, keys, serial)
|
||||
}
|
||||
KeyboardFocusTarget::Popup(p) => {
|
||||
KeyboardTarget::enter(p.wl_surface(), seat, data, keys, serial)
|
||||
|
|
@ -513,7 +603,9 @@ impl KeyboardTarget<State> for KeyboardFocusTarget {
|
|||
KeyboardFocusTarget::Element(w) => KeyboardTarget::leave(w, seat, data, serial),
|
||||
KeyboardFocusTarget::Fullscreen(w) => KeyboardTarget::leave(w, seat, data, serial),
|
||||
KeyboardFocusTarget::Group(_) => {}
|
||||
KeyboardFocusTarget::LayerSurface(l) => KeyboardTarget::leave(l, seat, data, serial),
|
||||
KeyboardFocusTarget::LayerSurface(l) => {
|
||||
KeyboardTarget::leave(l.wl_surface(), seat, data, serial)
|
||||
}
|
||||
KeyboardFocusTarget::Popup(p) => {
|
||||
KeyboardTarget::leave(p.wl_surface(), seat, data, serial)
|
||||
}
|
||||
|
|
@ -540,7 +632,7 @@ impl KeyboardTarget<State> for KeyboardFocusTarget {
|
|||
}
|
||||
KeyboardFocusTarget::Group(_) => {}
|
||||
KeyboardFocusTarget::LayerSurface(l) => {
|
||||
KeyboardTarget::key(l, seat, data, key, state, serial, time)
|
||||
KeyboardTarget::key(l.wl_surface(), seat, data, key, state, serial, time)
|
||||
}
|
||||
KeyboardFocusTarget::Popup(p) => {
|
||||
KeyboardTarget::key(p.wl_surface(), seat, data, key, state, serial, time)
|
||||
|
|
@ -566,7 +658,7 @@ impl KeyboardTarget<State> for KeyboardFocusTarget {
|
|||
}
|
||||
KeyboardFocusTarget::Group(_) => {}
|
||||
KeyboardFocusTarget::LayerSurface(l) => {
|
||||
KeyboardTarget::modifiers(l, seat, data, modifiers, serial)
|
||||
KeyboardTarget::modifiers(l.wl_surface(), seat, data, modifiers, serial)
|
||||
}
|
||||
KeyboardFocusTarget::Popup(p) => {
|
||||
KeyboardTarget::modifiers(p.wl_surface(), seat, data, modifiers, serial)
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ impl CompositorHandler for State {
|
|||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
fn commit(&mut self, surface: &WlSurface) {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ use std::cell::RefCell;
|
|||
impl SeatHandler for State {
|
||||
type KeyboardFocus = KeyboardFocusTarget;
|
||||
type PointerFocus = PointerFocusTarget;
|
||||
type TouchFocus = PointerFocusTarget;
|
||||
|
||||
fn seat_state(&mut self) -> &mut SeatState<Self> {
|
||||
&mut self.common.seat_state
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue