Skip to content

Commit

Permalink
fix: iced_layershell multi id mark cannot work
Browse files Browse the repository at this point in the history
  • Loading branch information
Decodetalkers committed Dec 3, 2024
1 parent 881f77c commit 67d64e2
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 37 deletions.
36 changes: 18 additions & 18 deletions Cargo.lock

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

18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ authors = [
"Aakash Sen Sharma <[email protected]>",
]
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"
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"
Expand Down
136 changes: 126 additions & 10 deletions iced_layershell/src/build_pattern/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self::WindowInfo> {
None
}
fn id_info(&self, _state: &Self::State, _id: iced_core::window::Id)
-> Option<Self::WindowInfo>;

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`].
Expand Down Expand Up @@ -518,6 +512,27 @@ fn with_namespace<P: Program>(
(self.namespace)(state)
}

fn id_info(
&self,
state: &Self::State,
id: iced_core::window::Id,
) -> Option<Self::WindowInfo> {
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::Message> {
self.program.update(state, message)
}
Expand Down Expand Up @@ -570,6 +585,26 @@ pub fn with_subscription<P: Program>(
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::WindowInfo> {
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::Message> {
(self.subscription)(state)
Expand Down Expand Up @@ -630,6 +665,26 @@ pub fn with_theme<P: Program>(
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::WindowInfo> {
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)
Expand Down Expand Up @@ -687,6 +742,26 @@ pub fn with_style<P: Program>(
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::WindowInfo> {
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)
Expand Down Expand Up @@ -744,6 +819,26 @@ pub fn with_scale_factor<P: Program>(
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::WindowInfo> {
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)
Expand Down Expand Up @@ -806,6 +901,27 @@ pub fn with_executor<P: Program, E: iced_futures::Executor>(
type Executor = E;
type WindowInfo = P::WindowInfo;

fn id_info(
&self,
state: &Self::State,
id: iced_core::window::Id,
) -> Option<Self::WindowInfo> {
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)
}
Expand Down

0 comments on commit 67d64e2

Please sign in to comment.