mirror of
https://codeberg.org/waydeer/layer-shika.git
synced 2025-12-12 16:35:56 +00:00
fix: hardcoded surface name
This commit is contained in:
parent
aa536c9487
commit
b5ebb52d9c
6 changed files with 15 additions and 3 deletions
|
|
@ -23,6 +23,7 @@ pub(crate) struct LayerSurfaceConfig {
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct WaylandSurfaceConfig {
|
pub struct WaylandSurfaceConfig {
|
||||||
|
pub surface_name: String,
|
||||||
pub height: u32,
|
pub height: u32,
|
||||||
pub width: u32,
|
pub width: u32,
|
||||||
pub layer: zwlr_layer_shell_v1::Layer,
|
pub layer: zwlr_layer_shell_v1::Layer,
|
||||||
|
|
@ -40,11 +41,13 @@ pub struct WaylandSurfaceConfig {
|
||||||
impl WaylandSurfaceConfig {
|
impl WaylandSurfaceConfig {
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn from_domain_config(
|
pub fn from_domain_config(
|
||||||
|
surface_name: impl Into<String>,
|
||||||
component_definition: ComponentDefinition,
|
component_definition: ComponentDefinition,
|
||||||
compilation_result: Option<Rc<CompilationResult>>,
|
compilation_result: Option<Rc<CompilationResult>>,
|
||||||
domain_config: DomainSurfaceConfig,
|
domain_config: DomainSurfaceConfig,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
surface_name: surface_name.into(),
|
||||||
height: domain_config.dimensions.height(),
|
height: domain_config.dimensions.height(),
|
||||||
width: domain_config.dimensions.width(),
|
width: domain_config.dimensions.width(),
|
||||||
layer: convert_layer(domain_config.layer),
|
layer: convert_layer(domain_config.layer),
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,12 @@ impl OutputManager {
|
||||||
let (window, main_surface_id) =
|
let (window, main_surface_id) =
|
||||||
self.create_window_for_output(&pending_output.proxy, output_id, queue_handle)?;
|
self.create_window_for_output(&pending_output.proxy, output_id, queue_handle)?;
|
||||||
|
|
||||||
app_state.add_output(output_id, main_surface_id, window);
|
app_state.add_output(
|
||||||
|
output_id,
|
||||||
|
&self.config.surface_name,
|
||||||
|
main_surface_id,
|
||||||
|
window,
|
||||||
|
);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@ impl WaylandWindowingSystem {
|
||||||
main_surface_id,
|
main_surface_id,
|
||||||
window,
|
window,
|
||||||
builder,
|
builder,
|
||||||
shell_surface_name: "default".to_string(),
|
shell_surface_name: config.surface_name.clone(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,10 +99,11 @@ impl AppState {
|
||||||
pub fn add_output(
|
pub fn add_output(
|
||||||
&mut self,
|
&mut self,
|
||||||
output_id: &ObjectId,
|
output_id: &ObjectId,
|
||||||
|
surface_name: &str,
|
||||||
main_surface_id: ObjectId,
|
main_surface_id: ObjectId,
|
||||||
surface_state: PerOutputWindow,
|
surface_state: PerOutputWindow,
|
||||||
) {
|
) {
|
||||||
self.add_shell_surface(output_id, "default", main_surface_id, surface_state);
|
self.add_shell_surface(output_id, surface_name, main_surface_id, surface_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn remove_output(&mut self, handle: OutputHandle) -> Vec<PerOutputWindow> {
|
pub fn remove_output(&mut self, handle: OutputHandle) -> Vec<PerOutputWindow> {
|
||||||
|
|
|
||||||
|
|
@ -383,6 +383,7 @@ impl Shell {
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let wayland_config = WaylandSurfaceConfig::from_domain_config(
|
let wayland_config = WaylandSurfaceConfig::from_domain_config(
|
||||||
|
&definition.component,
|
||||||
component_definition,
|
component_definition,
|
||||||
Some(Rc::clone(&compilation_result)),
|
Some(Rc::clone(&compilation_result)),
|
||||||
definition.config.clone(),
|
definition.config.clone(),
|
||||||
|
|
@ -430,6 +431,7 @@ impl Shell {
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let wayland_config = WaylandSurfaceConfig::from_domain_config(
|
let wayland_config = WaylandSurfaceConfig::from_domain_config(
|
||||||
|
&def.component,
|
||||||
component_definition,
|
component_definition,
|
||||||
Some(Rc::clone(&compilation_result)),
|
Some(Rc::clone(&compilation_result)),
|
||||||
def.config.clone(),
|
def.config.clone(),
|
||||||
|
|
|
||||||
|
|
@ -566,6 +566,7 @@ impl SingleWindowShell {
|
||||||
config: SurfaceConfig,
|
config: SurfaceConfig,
|
||||||
) -> Result<Self> {
|
) -> Result<Self> {
|
||||||
let wayland_config = WaylandSurfaceConfig::from_domain_config(
|
let wayland_config = WaylandSurfaceConfig::from_domain_config(
|
||||||
|
"default",
|
||||||
component_definition,
|
component_definition,
|
||||||
compilation_result,
|
compilation_result,
|
||||||
config,
|
config,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue