Skip to content

Commit

Permalink
feat: add subscriber for wayland
Browse files Browse the repository at this point in the history
This pr add a new crate to support listen to the addon of output.

and allow new layershell be add to target output
  • Loading branch information
Decodetalkers committed Nov 10, 2024
1 parent 0cb7a19 commit d3dae06
Show file tree
Hide file tree
Showing 12 changed files with 852 additions and 135 deletions.
125 changes: 12 additions & 113 deletions Cargo.lock

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

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ members = [
"iced_layershell_macros",
"iced_sessionlock",
"iced_sessionlock_macros",
"starcolorkeyboard",
"iced_wayland_subscriber",
"sessionlockev",
"waycrate_xkbkeycode",
"iced_examples/*",
Expand All @@ -28,6 +28,7 @@ readme = "README.md"
[workspace.dependencies]
layershellev = { version = "0.9.6", path = "./layershellev" }
sessionlockev = { version = "0.9.6", path = "./sessionlockev" }
iced_wayland_subscriber = { version = "0.9.6", path = "./iced_wayland_subscriber" }

iced_layershell = { version = "0.9.6", path = "./iced_layershell" }
iced_layershell_macros = { version = "0.9.6", path = "./iced_layershell_macros" }
Expand Down Expand Up @@ -79,7 +80,7 @@ bitflags = "2.6.0"
log = "0.4.22"

xkbcommon-dl = "0.4.2"
smol_str = "0.2.2" #NOTE: follow iced
smol_str = "0.2.2" #NOTE: follow iced
memmap2 = "0.9.5"

tracing = "0.1.40"
Expand Down
8 changes: 5 additions & 3 deletions iced_examples/counter_muti/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use iced_layershell::actions::{IcedNewMenuSettings, MenuDirection};
use iced_runtime::window::Action as WindowAction;
use iced_runtime::{task, Action};

use iced_layershell::reexport::{Anchor, KeyboardInteractivity, Layer, NewLayerShellSettings};
use iced_layershell::reexport::{
Anchor, KeyboardInteractivity, Layer, LayerOutputSetting, NewLayerShellSettings,
};
use iced_layershell::settings::{LayerShellSettings, Settings, StartMode};
use iced_layershell::to_layer_message;
use iced_layershell::MultiApplication;
Expand Down Expand Up @@ -180,7 +182,7 @@ impl MultiApplication for Counter {
layer: Layer::Top,
margin: None,
keyboard_interactivity: KeyboardInteractivity::Exclusive,
use_last_output: false,
output_setting: LayerOutputSetting::None,
},
info: WindowInfo::Left,
}),
Expand All @@ -192,7 +194,7 @@ impl MultiApplication for Counter {
layer: Layer::Top,
margin: None,
keyboard_interactivity: KeyboardInteractivity::Exclusive,
use_last_output: false,
output_setting: LayerOutputSetting::None,
},
info: WindowInfo::Right,
}),
Expand Down
6 changes: 4 additions & 2 deletions iced_examples/zbus_invoked_widget/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ use iced_layershell::actions::{
use iced_runtime::window::Action as WindowAction;
use iced_runtime::Action;

use iced_layershell::reexport::{Anchor, KeyboardInteractivity, Layer, NewLayerShellSettings};
use iced_layershell::reexport::{
Anchor, KeyboardInteractivity, Layer, LayerOutputSetting, NewLayerShellSettings,
};
use iced_layershell::settings::{LayerShellSettings, Settings, StartMode};
use iced_layershell::MultiApplication;
use zbus::{connection, interface};
Expand Down Expand Up @@ -53,7 +55,7 @@ impl TryInto<LaLaShellIdAction> for Message {
layer: Layer::Top,
margin: Some((100, 100, 100, 100)),
keyboard_interactivity: KeyboardInteractivity::OnDemand,
use_last_output: false,
output_setting: LayerOutputSetting::None,
},
(),
)),
Expand Down
6 changes: 3 additions & 3 deletions iced_layershell/src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub struct IcedNewMenuSettings {
pub direction: MenuDirection,
}

#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone)]
pub enum LayershellCustomActionsWithInfo<INFO: Clone> {
AnchorChange(Anchor),
LayerChange(Layer),
Expand All @@ -55,7 +55,7 @@ pub enum LayershellCustomActionsWithInfo<INFO: Clone> {

pub type LayershellCustomActions = LayershellCustomActionsWithInfo<()>;

#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone)]
pub struct LayershellCustomActionsWithIdAndInfo<INFO: Clone>(
pub Option<IcedId>,
pub LayershellCustomActionsWithInfo<INFO>,
Expand All @@ -70,7 +70,7 @@ impl<INFO: Clone> LayershellCustomActionsWithIdAndInfo<INFO> {
pub type LayershellCustomActionsWithId = LayershellCustomActionsWithIdAndInfo<()>;

// first one means
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone)]
pub(crate) struct LayershellCustomActionsWithIdInner<INFO: Clone>(
pub Option<LayerId>, // come from
pub Option<LayerId>, // target if has one
Expand Down
1 change: 1 addition & 0 deletions iced_layershell/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub mod reexport {
pub use layershellev::reexport::Anchor;
pub use layershellev::reexport::KeyboardInteractivity;
pub use layershellev::reexport::Layer;
pub use layershellev::LayerOutputSetting;
pub use layershellev::NewLayerShellSettings;
}

Expand Down
1 change: 1 addition & 0 deletions iced_wayland_subscriber/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
Loading

0 comments on commit d3dae06

Please sign in to comment.