From 67d64e29d387b919deae80c2bb9507b7576efefe Mon Sep 17 00:00:00 2001 From: ShootingStarDragons Date: Wed, 4 Dec 2024 00:43:39 +0900 Subject: [PATCH] fix: iced_layershell multi id mark cannot work --- Cargo.lock | 36 +++--- Cargo.toml | 18 +-- iced_layershell/src/build_pattern/daemon.rs | 136 ++++++++++++++++++-- 3 files changed, 153 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ba396e9..022db7f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -110,7 +110,7 @@ dependencies = [ [[package]] name = "application-launcher" -version = "0.11.0-rc4" +version = "0.11.0-rc5" dependencies = [ "gio", "iced", @@ -405,7 +405,7 @@ dependencies = [ [[package]] name = "bottom_panel" -version = "0.11.0-rc4" +version = "0.11.0-rc5" dependencies = [ "gio", "iced", @@ -783,7 +783,7 @@ dependencies = [ [[package]] name = "counter" -version = "0.11.0-rc4" +version = "0.11.0-rc5" dependencies = [ "iced", "iced_layershell", @@ -792,7 +792,7 @@ dependencies = [ [[package]] name = "counter_lock" -version = "0.11.0-rc4" +version = "0.11.0-rc5" dependencies = [ "iced", "iced_runtime", @@ -801,7 +801,7 @@ dependencies = [ [[package]] name = "counter_lock_pattern" -version = "0.11.0-rc4" +version = "0.11.0-rc5" dependencies = [ "iced", "iced_runtime", @@ -810,7 +810,7 @@ dependencies = [ [[package]] name = "counter_multi" -version = "0.11.0-rc4" +version = "0.11.0-rc5" dependencies = [ "iced", "iced_layershell", @@ -820,7 +820,7 @@ dependencies = [ [[package]] name = "counter_multi_pattern" -version = "0.11.0-rc4" +version = "0.11.0-rc5" dependencies = [ "iced", "iced_layershell", @@ -830,7 +830,7 @@ dependencies = [ [[package]] name = "counter_pattern" -version = "0.11.0-rc4" +version = "0.11.0-rc5" dependencies = [ "iced", "iced_layershell", @@ -1825,7 +1825,7 @@ dependencies = [ [[package]] name = "iced_layershell" -version = "0.11.0-rc4" +version = "0.11.0-rc5" dependencies = [ "futures", "iced", @@ -1844,7 +1844,7 @@ dependencies = [ [[package]] name = "iced_layershell_macros" -version = "0.11.0-rc4" +version = "0.11.0-rc5" dependencies = [ "darling", "manyhow", @@ -1881,7 +1881,7 @@ dependencies = [ [[package]] name = "iced_sessionlock" -version = "0.11.0-rc4" +version = "0.11.0-rc5" dependencies = [ "futures", "iced", @@ -1900,7 +1900,7 @@ dependencies = [ [[package]] name = "iced_sessionlock_macros" -version = "0.11.0-rc4" +version = "0.11.0-rc5" dependencies = [ "darling", "manyhow", @@ -1928,7 +1928,7 @@ dependencies = [ [[package]] name = "iced_virtualkeyboard" -version = "0.11.0-rc4" +version = "0.11.0-rc5" dependencies = [ "iced", "iced_layershell", @@ -2147,7 +2147,7 @@ dependencies = [ [[package]] name = "layershellev" -version = "0.11.0-rc4" +version = "0.11.0-rc5" dependencies = [ "bitflags 2.6.0", "calloop 0.14.1", @@ -3515,7 +3515,7 @@ dependencies = [ [[package]] name = "sessionlockev" -version = "0.11.0-rc4" +version = "0.11.0-rc5" dependencies = [ "bitflags 2.6.0", "calloop 0.14.1", @@ -3727,7 +3727,7 @@ dependencies = [ [[package]] name = "starcolorkeyboard" -version = "0.11.0-rc4" +version = "0.11.0-rc5" dependencies = [ "bitflags 2.6.0", "cairo-rs", @@ -4316,7 +4316,7 @@ dependencies = [ [[package]] name = "waycrate_xkbkeycode" -version = "0.11.0-rc4" +version = "0.11.0-rc5" dependencies = [ "bitflags 2.6.0", "calloop 0.14.1", @@ -5100,7 +5100,7 @@ dependencies = [ [[package]] name = "zbus_invoked_widget" -version = "0.11.0-rc4" +version = "0.11.0-rc5" dependencies = [ "futures", "iced", diff --git a/Cargo.toml b/Cargo.toml index a901363..650ca54 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ authors = [ "Aakash Sen Sharma ", ] edition = "2021" -version = "0.11.0-rc4" +version = "0.11.0-rc5" 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.11.0-rc4", path = "./layershellev" } -sessionlockev = { version = "0.11.0-rc4", path = "./sessionlockev" } - -iced_layershell = { version = "0.11.0-rc4", path = "./iced_layershell" } -iced_layershell_macros = { version = "0.11.0-rc4", path = "./iced_layershell_macros" } -iced_sessionlock = { version = "0.11.0-rc4", path = "./iced_sessionlock" } -iced_sessionlock_macros = { version = "0.11.0-rc4", path = "./iced_sessionlock_macros" } -waycrate_xkbkeycode = { version = "0.11.0-rc4", path = "./waycrate_xkbkeycode" } +layershellev = { version = "0.11.0-rc5", path = "./layershellev" } +sessionlockev = { version = "0.11.0-rc5", path = "./sessionlockev" } + +iced_layershell = { version = "0.11.0-rc5", path = "./iced_layershell" } +iced_layershell_macros = { version = "0.11.0-rc5", path = "./iced_layershell_macros" } +iced_sessionlock = { version = "0.11.0-rc5", path = "./iced_sessionlock" } +iced_sessionlock_macros = { version = "0.11.0-rc5", path = "./iced_sessionlock_macros" } +waycrate_xkbkeycode = { version = "0.11.0-rc5", path = "./waycrate_xkbkeycode" } tempfile = "3.14.0" thiserror = "1.0.69" diff --git a/iced_layershell/src/build_pattern/daemon.rs b/iced_layershell/src/build_pattern/daemon.rs index f4853f3..ad58528 100644 --- a/iced_layershell/src/build_pattern/daemon.rs +++ b/iced_layershell/src/build_pattern/daemon.rs @@ -36,22 +36,16 @@ pub trait Program: Sized { /// The theme of your [`Application`]. type Theme: Default + DefaultStyle; - fn id_info( - &self, - _state: &Self::State, - _id: iced_core::window::Id, - ) -> Option { - None - } + fn id_info(&self, _state: &Self::State, _id: iced_core::window::Id) + -> Option; fn set_id_info( &self, _state: &mut Self::State, _id: iced_core::window::Id, _info: Self::WindowInfo, - ) { - } - fn remove_id(&self, _state: &mut Self::State, _id: iced_core::window::Id) {} + ); + fn remove_id(&self, _state: &mut Self::State, _id: iced_core::window::Id); /// Initializes the [`Application`] with the flags provided to /// [`run`] as part of the [`Settings`]. @@ -518,6 +512,27 @@ fn with_namespace( (self.namespace)(state) } + fn id_info( + &self, + state: &Self::State, + id: iced_core::window::Id, + ) -> Option { + self.program.id_info(state, id) + } + + fn remove_id(&self, state: &mut Self::State, id: iced_core::window::Id) { + self.program.remove_id(state, id) + } + + fn set_id_info( + &self, + state: &mut Self::State, + id: iced_core::window::Id, + info: Self::WindowInfo, + ) { + self.program.set_id_info(state, id, info) + } + fn update(&self, state: &mut Self::State, message: Self::Message) -> Task { self.program.update(state, message) } @@ -570,6 +585,26 @@ pub fn with_subscription( type Renderer = P::Renderer; type Executor = P::Executor; type WindowInfo = P::WindowInfo; + fn id_info( + &self, + state: &Self::State, + id: iced_core::window::Id, + ) -> Option { + self.program.id_info(state, id) + } + + fn remove_id(&self, state: &mut Self::State, id: iced_core::window::Id) { + self.program.remove_id(state, id) + } + + fn set_id_info( + &self, + state: &mut Self::State, + id: iced_core::window::Id, + info: Self::WindowInfo, + ) { + self.program.set_id_info(state, id, info) + } fn subscription(&self, state: &Self::State) -> iced::Subscription { (self.subscription)(state) @@ -630,6 +665,26 @@ pub fn with_theme( type Renderer = P::Renderer; type Executor = P::Executor; type WindowInfo = P::WindowInfo; + fn id_info( + &self, + state: &Self::State, + id: iced_core::window::Id, + ) -> Option { + self.program.id_info(state, id) + } + + fn remove_id(&self, state: &mut Self::State, id: iced_core::window::Id) { + self.program.remove_id(state, id) + } + + fn set_id_info( + &self, + state: &mut Self::State, + id: iced_core::window::Id, + info: Self::WindowInfo, + ) { + self.program.set_id_info(state, id, info) + } fn theme(&self, state: &Self::State) -> Self::Theme { (self.theme)(state) @@ -687,6 +742,26 @@ pub fn with_style( type Renderer = P::Renderer; type Executor = P::Executor; type WindowInfo = P::WindowInfo; + fn id_info( + &self, + state: &Self::State, + id: iced_core::window::Id, + ) -> Option { + self.program.id_info(state, id) + } + + fn remove_id(&self, state: &mut Self::State, id: iced_core::window::Id) { + self.program.remove_id(state, id) + } + + fn set_id_info( + &self, + state: &mut Self::State, + id: iced_core::window::Id, + info: Self::WindowInfo, + ) { + self.program.set_id_info(state, id, info) + } fn style(&self, state: &Self::State, theme: &Self::Theme) -> crate::Appearance { (self.style)(state, theme) @@ -744,6 +819,26 @@ pub fn with_scale_factor( type Renderer = P::Renderer; type Executor = P::Executor; type WindowInfo = P::WindowInfo; + fn id_info( + &self, + state: &Self::State, + id: iced_core::window::Id, + ) -> Option { + self.program.id_info(state, id) + } + + fn remove_id(&self, state: &mut Self::State, id: iced_core::window::Id) { + self.program.remove_id(state, id) + } + + fn set_id_info( + &self, + state: &mut Self::State, + id: iced_core::window::Id, + info: Self::WindowInfo, + ) { + self.program.set_id_info(state, id, info) + } fn namespace(&self, state: &Self::State) -> String { self.program.namespace(state) @@ -806,6 +901,27 @@ pub fn with_executor( type Executor = E; type WindowInfo = P::WindowInfo; + fn id_info( + &self, + state: &Self::State, + id: iced_core::window::Id, + ) -> Option { + self.program.id_info(state, id) + } + + fn remove_id(&self, state: &mut Self::State, id: iced_core::window::Id) { + self.program.remove_id(state, id) + } + + fn set_id_info( + &self, + state: &mut Self::State, + id: iced_core::window::Id, + info: Self::WindowInfo, + ) { + self.program.set_id_info(state, id, info) + } + fn namespace(&self, state: &Self::State) -> String { self.program.namespace(state) }