diff --git a/Cargo.lock b/Cargo.lock index 5a80db20..162d9e69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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", diff --git a/Cargo.toml b/Cargo.toml index 263f42c1..9fbcbf38 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"} diff --git a/src/input/mod.rs b/src/input/mod.rs index c7e61687..197a0640 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -47,6 +47,7 @@ use smithay::{ GestureSwipeBeginEvent, GestureSwipeEndEvent, GestureSwipeUpdateEvent, MotionEvent, RelativeMotionEvent, }, + touch::{DownEvent, MotionEvent as TouchMotionEvent, UpEvent}, Seat, SeatState, }, output::Output, @@ -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, .. } => { @@ -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) = diff --git a/src/shell/element/surface.rs b/src/shell/element/surface.rs index 375ae512..2dad2e46 100644 --- a/src/shell/element/surface.rs +++ b/src/shell/element/surface.rs @@ -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 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, 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 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 for CosmicSurface { modifiers: ModifiersState, serial: smithay::utils::Serial, ) { - KeyboardTarget::modifiers(&self.0, seat, data, modifiers, serial) - } -} - -impl PointerTarget for CosmicSurface { - fn enter(&self, seat: &Seat, data: &mut State, event: &MotionEvent) { - PointerTarget::enter(&self.0, seat, data, event) - } - - fn motion(&self, seat: &Seat, data: &mut State, event: &MotionEvent) { - PointerTarget::motion(&self.0, seat, data, event) - } - - fn relative_motion(&self, seat: &Seat, data: &mut State, event: &RelativeMotionEvent) { - PointerTarget::relative_motion(&self.0, seat, data, event) - } - - fn button(&self, seat: &Seat, data: &mut State, event: &ButtonEvent) { - PointerTarget::button(&self.0, seat, data, event) - } - - fn axis(&self, seat: &Seat, data: &mut State, frame: AxisFrame) { - PointerTarget::axis(&self.0, seat, data, frame) - } - - fn frame(&self, seat: &Seat, data: &mut State) { - PointerTarget::frame(&self.0, seat, data) - } - - fn leave( - &self, - seat: &Seat, - data: &mut State, - serial: smithay::utils::Serial, - time: u32, - ) { - PointerTarget::leave(&self.0, seat, data, serial, time) - } - - fn gesture_swipe_begin( - &self, - seat: &Seat, - data: &mut State, - event: &GestureSwipeBeginEvent, - ) { - PointerTarget::gesture_swipe_begin(&self.0, seat, data, event) - } - - fn gesture_swipe_update( - &self, - seat: &Seat, - data: &mut State, - event: &GestureSwipeUpdateEvent, - ) { - PointerTarget::gesture_swipe_update(&self.0, seat, data, event) - } - - fn gesture_swipe_end( - &self, - seat: &Seat, - data: &mut State, - event: &GestureSwipeEndEvent, - ) { - PointerTarget::gesture_swipe_end(&self.0, seat, data, event) - } - - fn gesture_pinch_begin( - &self, - seat: &Seat, - data: &mut State, - event: &GesturePinchBeginEvent, - ) { - PointerTarget::gesture_pinch_begin(&self.0, seat, data, event) - } - - fn gesture_pinch_update( - &self, - seat: &Seat, - data: &mut State, - event: &GesturePinchUpdateEvent, - ) { - PointerTarget::gesture_pinch_update(&self.0, seat, data, event) - } - - fn gesture_pinch_end( - &self, - seat: &Seat, - data: &mut State, - event: &GesturePinchEndEvent, - ) { - PointerTarget::gesture_pinch_end(&self.0, seat, data, event) - } - - fn gesture_hold_begin( - &self, - seat: &Seat, - data: &mut State, - event: &GestureHoldBeginEvent, - ) { - PointerTarget::gesture_hold_begin(&self.0, seat, data, event) - } - - fn gesture_hold_end(&self, seat: &Seat, data: &mut State, event: &GestureHoldEndEvent) { - PointerTarget::gesture_hold_end(&self.0, seat, data, event) + 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) + } + } } } diff --git a/src/shell/focus/target.rs b/src/shell/focus/target.rs index d4efe527..9a4e14bc 100644 --- a/src/shell/focus/target.rs +++ b/src/shell/focus/target.rs @@ -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 for PointerFocusTarget { - fn enter(&self, seat: &Seat, data: &mut State, event: &MotionEvent) { + fn enter(&self, seat: &Seat, 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 for PointerFocusTarget { PointerFocusTarget::ResizeFork(f) => PointerTarget::enter(f, seat, data, event), } } - fn motion(&self, seat: &Seat, data: &mut State, event: &MotionEvent) { + fn motion(&self, seat: &Seat, 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 for PointerFocusTarget { } } +impl TouchTarget for PointerFocusTarget { + fn down(&self, seat: &Seat, 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, 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, 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, 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, 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, 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, + 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 for KeyboardFocusTarget { fn enter( &self, @@ -498,7 +588,7 @@ impl KeyboardTarget 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 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 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 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) diff --git a/src/wayland/handlers/compositor.rs b/src/wayland/handlers/compositor.rs index fd9d5116..02e122d8 100644 --- a/src/wayland/handlers/compositor.rs +++ b/src/wayland/handlers/compositor.rs @@ -136,7 +136,7 @@ impl CompositorHandler for State { } } } - }) + }); } fn commit(&mut self, surface: &WlSurface) { diff --git a/src/wayland/handlers/seat.rs b/src/wayland/handlers/seat.rs index 6ef87138..f959e40e 100644 --- a/src/wayland/handlers/seat.rs +++ b/src/wayland/handlers/seat.rs @@ -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 { &mut self.common.seat_state