From 8293dcd456467fdf1dd4e49e76a596c443518bdf Mon Sep 17 00:00:00 2001 From: ShootingStarDragons Date: Tue, 22 Oct 2024 19:50:37 +0900 Subject: [PATCH] feat: bump version to 0.9.4-rc3 add scale information to axis event --- Cargo.lock | 30 +++++++++++++++--------------- Cargo.toml | 18 +++++++++--------- iced_layershell/src/event.rs | 9 +++++---- iced_sessionlock/src/event.rs | 9 +++++---- layershellev/src/events.rs | 4 ++++ layershellev/src/lib.rs | 9 +++++++++ sessionlockev/src/events.rs | 4 ++++ sessionlockev/src/lib.rs | 9 +++++++++ 8 files changed, 60 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 94a5e4e..fc0cfb5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -116,7 +116,7 @@ dependencies = [ [[package]] name = "application-launcher" -version = "0.9.4-rc2" +version = "0.9.4-rc3" dependencies = [ "gio", "iced", @@ -411,7 +411,7 @@ dependencies = [ [[package]] name = "bottom_panel" -version = "0.9.4-rc2" +version = "0.9.4-rc3" dependencies = [ "gio", "iced", @@ -789,7 +789,7 @@ dependencies = [ [[package]] name = "counter" -version = "0.9.4-rc2" +version = "0.9.4-rc3" dependencies = [ "iced", "iced_layershell", @@ -798,7 +798,7 @@ dependencies = [ [[package]] name = "counter_lock" -version = "0.9.4-rc2" +version = "0.9.4-rc3" dependencies = [ "iced", "iced_runtime", @@ -807,7 +807,7 @@ dependencies = [ [[package]] name = "counter_multi" -version = "0.9.4-rc2" +version = "0.9.4-rc3" dependencies = [ "iced", "iced_layershell", @@ -1812,7 +1812,7 @@ dependencies = [ [[package]] name = "iced_layershell" -version = "0.9.4-rc2" +version = "0.9.4-rc3" dependencies = [ "futures", "iced", @@ -1831,7 +1831,7 @@ dependencies = [ [[package]] name = "iced_layershell_macros" -version = "0.9.4-rc2" +version = "0.9.4-rc3" dependencies = [ "darling", "manyhow", @@ -1868,7 +1868,7 @@ dependencies = [ [[package]] name = "iced_sessionlock" -version = "0.9.4-rc2" +version = "0.9.4-rc3" dependencies = [ "futures", "iced", @@ -1887,7 +1887,7 @@ dependencies = [ [[package]] name = "iced_sessionlock_macros" -version = "0.9.4-rc2" +version = "0.9.4-rc3" dependencies = [ "darling", "manyhow", @@ -1915,7 +1915,7 @@ dependencies = [ [[package]] name = "iced_virtualkeyboard" -version = "0.9.4-rc2" +version = "0.9.4-rc3" dependencies = [ "iced", "iced_layershell", @@ -2133,7 +2133,7 @@ dependencies = [ [[package]] name = "layershellev" -version = "0.9.4-rc2" +version = "0.9.4-rc3" dependencies = [ "bitflags 2.6.0", "calloop 0.14.1", @@ -3465,7 +3465,7 @@ dependencies = [ [[package]] name = "sessionlockev" -version = "0.9.4-rc2" +version = "0.9.4-rc3" dependencies = [ "bitflags 2.6.0", "calloop 0.14.1", @@ -3677,7 +3677,7 @@ dependencies = [ [[package]] name = "starcolorkeyboard" -version = "0.9.4-rc2" +version = "0.9.4-rc3" dependencies = [ "bitflags 2.6.0", "cairo-rs", @@ -4219,7 +4219,7 @@ dependencies = [ [[package]] name = "waycrate_xkbkeycode" -version = "0.9.4-rc2" +version = "0.9.4-rc3" dependencies = [ "bitflags 2.6.0", "log", @@ -5002,7 +5002,7 @@ dependencies = [ [[package]] name = "zbus_invoked_widget" -version = "0.9.4-rc2" +version = "0.9.4-rc3" dependencies = [ "futures", "iced", diff --git a/Cargo.toml b/Cargo.toml index 6779e44..d0cd34d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ authors = [ "Aakash Sen Sharma ", ] edition = "2021" -version = "0.9.4-rc2" +version = "0.9.4-rc3" license = "MIT" repository = "https://github.com/waycrate/exwlshelleventloop" description = "Wayland extra shell lib" @@ -26,14 +26,14 @@ keywords = ["wayland", "wlroots"] readme = "README.md" [workspace.dependencies] -layershellev = { version = "0.9.4-rc2", path = "./layershellev" } -sessionlockev = { version = "0.9.4-rc2", path = "./sessionlockev" } - -iced_layershell = { version = "0.9.4-rc2", path = "./iced_layershell" } -iced_layershell_macros = { version = "0.9.4-rc2", path = "./iced_layershell_macros" } -iced_sessionlock = { version = "0.9.4-rc2", path = "./iced_sessionlock" } -iced_sessionlock_macros = { version = "0.9.4-rc2", path = "./iced_sessionlock_macros" } -waycrate_xkbkeycode = { version = "0.9.4-rc2", path = "./waycrate_xkbkeycode" } +layershellev = { version = "0.9.4-rc3", path = "./layershellev" } +sessionlockev = { version = "0.9.4-rc3", path = "./sessionlockev" } + +iced_layershell = { version = "0.9.4-rc3", path = "./iced_layershell" } +iced_layershell_macros = { version = "0.9.4-rc3", path = "./iced_layershell_macros" } +iced_sessionlock = { version = "0.9.4-rc3", path = "./iced_sessionlock" } +iced_sessionlock_macros = { version = "0.9.4-rc3", path = "./iced_sessionlock_macros" } +waycrate_xkbkeycode = { version = "0.9.4-rc3", path = "./waycrate_xkbkeycode" } tempfile = "3.13.0" thiserror = "1.0.64" diff --git a/iced_layershell/src/event.rs b/iced_layershell/src/event.rs index 6367802..60a3ff3 100644 --- a/iced_layershell/src/event.rs +++ b/iced_layershell/src/event.rs @@ -215,6 +215,7 @@ impl From<&DispatchMessage> for IcedLayerEvent { if horizontal.stop && vertical.stop { @@ -223,13 +224,13 @@ impl From<&DispatchMessage> for IcedLayerEvent From<&DispatchMessage> for IcedSessionLockEvent DispatchMessage::Axis { horizontal, vertical, + scale, .. } => { if horizontal.stop && vertical.stop { @@ -200,13 +201,13 @@ impl From<&DispatchMessage> for IcedSessionLockEvent let has_scroll = vertical.discrete != 0 || horizontal.discrete != 0; if has_scroll { return IcedSessionLockEvent::Window(WindowEvent::Axis { - x: -horizontal.discrete as f32, - y: -vertical.discrete as f32, + x: (-horizontal.discrete as f64 * scale) as f32, + y: (-vertical.discrete as f64 * scale) as f32, }); } IcedSessionLockEvent::Window(WindowEvent::PixelDelta { - x: -horizontal.absolute as f32, - y: -vertical.absolute as f32, + x: (-horizontal.absolute * scale) as f32, + y: (-vertical.absolute * scale) as f32, }) } } diff --git a/layershellev/src/events.rs b/layershellev/src/events.rs index f395f1d..757af85 100644 --- a/layershellev/src/events.rs +++ b/layershellev/src/events.rs @@ -187,6 +187,7 @@ pub(crate) enum DispatchMessageInner { }, Axis { time: u32, + scale: f64, horizontal: AxisScroll, vertical: AxisScroll, source: Option, @@ -277,6 +278,7 @@ pub enum DispatchMessage { /// About the scroll Axis { time: u32, + scale: f64, horizontal: AxisScroll, vertical: AxisScroll, source: Option, @@ -411,11 +413,13 @@ impl From for DispatchMessage { }, DispatchMessageInner::Axis { time, + scale, horizontal, vertical, source, } => DispatchMessage::Axis { time, + scale, horizontal, vertical, source, diff --git a/layershellev/src/lib.rs b/layershellev/src/lib.rs index f68b1cd..84366ee 100644 --- a/layershellev/src/lib.rs +++ b/layershellev/src/lib.rs @@ -1357,6 +1357,11 @@ impl Dispatch for WindowState { _conn: &Connection, _qhandle: &wayland_client::QueueHandle, ) { + let scale = state + .surface_id() + .and_then(|id| state.get_unit_with_id(id)) + .map(|unit| unit.scale_float()) + .unwrap_or(1.0); match event { wl_pointer::Event::Axis { time, axis, value } => match axis { WEnum::Value(axis) => { @@ -1375,6 +1380,7 @@ impl Dispatch for WindowState { state.surface_id(), DispatchMessageInner::Axis { time, + scale, horizontal, vertical, source: None, @@ -1399,6 +1405,7 @@ impl Dispatch for WindowState { state.surface_id(), DispatchMessageInner::Axis { time, + scale, horizontal, vertical, source: None, @@ -1416,6 +1423,7 @@ impl Dispatch for WindowState { DispatchMessageInner::Axis { horizontal: AxisScroll::default(), vertical: AxisScroll::default(), + scale, source: Some(source), time: 0, }, @@ -1443,6 +1451,7 @@ impl Dispatch for WindowState { state.surface_id(), DispatchMessageInner::Axis { time: 0, + scale, horizontal, vertical, source: None, diff --git a/sessionlockev/src/events.rs b/sessionlockev/src/events.rs index bdb8de6..e11cef1 100644 --- a/sessionlockev/src/events.rs +++ b/sessionlockev/src/events.rs @@ -122,6 +122,7 @@ pub(crate) enum DispatchMessageInner { }, Axis { time: u32, + scale: f64, horizontal: AxisScroll, vertical: AxisScroll, source: Option, @@ -208,6 +209,7 @@ pub enum DispatchMessage { /// About the scroll Axis { time: u32, + scale: f64, horizontal: AxisScroll, vertical: AxisScroll, source: Option, @@ -353,11 +355,13 @@ impl From for DispatchMessage { }, DispatchMessageInner::Axis { time, + scale, horizontal, vertical, source, } => DispatchMessage::Axis { time, + scale, horizontal, vertical, source, diff --git a/sessionlockev/src/lib.rs b/sessionlockev/src/lib.rs index 3d377a8..ea9fb09 100644 --- a/sessionlockev/src/lib.rs +++ b/sessionlockev/src/lib.rs @@ -861,6 +861,11 @@ impl Dispatch for WindowState { _conn: &Connection, _qhandle: &wayland_client::QueueHandle, ) { + let scale = state + .surface_id() + .and_then(|id| state.get_unit_with_id(id)) + .map(|unit| unit.scale_float()) + .unwrap_or(1.0); match event { wl_pointer::Event::Axis { time, axis, value } => match axis { WEnum::Value(axis) => { @@ -879,6 +884,7 @@ impl Dispatch for WindowState { state.surface_id(), DispatchMessageInner::Axis { time, + scale, horizontal, vertical, source: None, @@ -903,6 +909,7 @@ impl Dispatch for WindowState { state.surface_id(), DispatchMessageInner::Axis { time, + scale, horizontal, vertical, source: None, @@ -922,6 +929,7 @@ impl Dispatch for WindowState { vertical: AxisScroll::default(), source: Some(source), time: 0, + scale, }, )), WEnum::Unknown(unknown) => { @@ -947,6 +955,7 @@ impl Dispatch for WindowState { state.surface_id(), DispatchMessageInner::Axis { time: 0, + scale, horizontal, vertical, source: None,