Skip to content

Commit 18cad79

Browse files
committed
feat(namespace): allow setting namespace when a new window is opened.
Signed-off-by: fortime <palfortime@gmail.com>
1 parent 5a47b5f commit 18cad79

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
@@ -69,7 +69,7 @@ pub enum LayerEvent<'a, T, Message> {
6969
}
7070

7171
/// layershell settings to create a new layershell surface
72-
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
72+
#[derive(Debug, Clone, PartialEq, Eq)]
7373
pub struct NewLayerShellSettings {
7474
/// the size of the layershell, optional.
7575
pub size: Option<(u32, u32)>,
@@ -83,6 +83,7 @@ pub struct NewLayerShellSettings {
8383
/// wl_output.
8484
pub use_last_output: bool,
8585
pub events_transparent: bool,
86+
pub namespace: Option<String>,
8687
}
8788

8889
/// be used to create a new popup
@@ -107,6 +108,7 @@ impl Default for NewLayerShellSettings {
107108
keyboard_interactivity: KeyboardInteractivity::OnDemand,
108109
use_last_output: false,
109110
events_transparent: false,
111+
namespace: None,
110112
}
111113
}
112114
}

layershellev/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2457,6 +2457,7 @@ impl<T: 'static> WindowState<T> {
24572457
keyboard_interactivity,
24582458
use_last_output,
24592459
events_transparent,
2460+
namespace,
24602461
},
24612462
id,
24622463
info,
@@ -2484,7 +2485,7 @@ impl<T: 'static> WindowState<T> {
24842485
&wl_surface,
24852486
output,
24862487
layer,
2487-
self.namespace.clone(),
2488+
namespace.clone().unwrap_or_else(|| self.namespace.clone()),
24882489
&qh,
24892490
(),
24902491
);

0 commit comments

Comments
 (0)