Skip to content

Commit f7ba07e

Browse files
authored
feat(namespace): allow setting namespace when a new window is opened. (#142)
* feat(layershell): allow setting namespace when a new window is opened. Signed-off-by: fortime <palfortime@gmail.com> * fix: remove redundancy clone. Signed-off-by: fortime <palfortime@gmail.com> --------- Signed-off-by: fortime <palfortime@gmail.com>
1 parent 7c8a19d commit f7ba07e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

layershellev/src/events.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub enum LayerEvent<'a, T, Message> {
7171
}
7272

7373
/// layershell settings to create a new layershell surface
74-
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
74+
#[derive(Debug, Clone, PartialEq, Eq)]
7575
pub struct NewLayerShellSettings {
7676
/// the size of the layershell, optional.
7777
pub size: Option<(u32, u32)>,
@@ -85,6 +85,7 @@ pub struct NewLayerShellSettings {
8585
/// wl_output.
8686
pub use_last_output: bool,
8787
pub events_transparent: bool,
88+
pub namespace: Option<String>,
8889
}
8990

9091
/// be used to create a new popup
@@ -121,6 +122,7 @@ impl Default for NewLayerShellSettings {
121122
keyboard_interactivity: KeyboardInteractivity::OnDemand,
122123
use_last_output: false,
123124
events_transparent: false,
125+
namespace: None,
124126
}
125127
}
126128
}

layershellev/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2849,6 +2849,7 @@ impl<T: 'static> WindowState<T> {
28492849
keyboard_interactivity,
28502850
use_last_output,
28512851
events_transparent,
2852+
namespace,
28522853
},
28532854
id,
28542855
info,
@@ -2880,7 +2881,7 @@ impl<T: 'static> WindowState<T> {
28802881
&wl_surface,
28812882
output,
28822883
layer,
2883-
window_state.namespace.clone(),
2884+
namespace.unwrap_or_else(|| window_state.namespace.clone()),
28842885
&qh,
28852886
(),
28862887
);

0 commit comments

Comments
 (0)