mirror of
https://codeberg.org/waydeer/layer-shika.git
synced 2025-12-12 14:25:54 +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)]
|
||||
pub struct WaylandSurfaceConfig {
|
||||
pub surface_name: String,
|
||||
pub height: u32,
|
||||
pub width: u32,
|
||||
pub layer: zwlr_layer_shell_v1::Layer,
|
||||
|
|
@ -40,11 +41,13 @@ pub struct WaylandSurfaceConfig {
|
|||
impl WaylandSurfaceConfig {
|
||||
#[must_use]
|
||||
pub fn from_domain_config(
|
||||
surface_name: impl Into<String>,
|
||||
component_definition: ComponentDefinition,
|
||||
compilation_result: Option<Rc<CompilationResult>>,
|
||||
domain_config: DomainSurfaceConfig,
|
||||
) -> Self {
|
||||
Self {
|
||||
surface_name: surface_name.into(),
|
||||
height: domain_config.dimensions.height(),
|
||||
width: domain_config.dimensions.width(),
|
||||
layer: convert_layer(domain_config.layer),
|
||||
|
|
|
|||
|
|
@ -144,7 +144,12 @@ impl OutputManager {
|
|||
let (window, main_surface_id) =
|
||||
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(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ impl WaylandWindowingSystem {
|
|||
main_surface_id,
|
||||
window,
|
||||
builder,
|
||||
shell_surface_name: "default".to_string(),
|
||||
shell_surface_name: config.surface_name.clone(),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,10 +99,11 @@ impl AppState {
|
|||
pub fn add_output(
|
||||
&mut self,
|
||||
output_id: &ObjectId,
|
||||
surface_name: &str,
|
||||
main_surface_id: ObjectId,
|
||||
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> {
|
||||
|
|
|
|||
|
|
@ -383,6 +383,7 @@ impl Shell {
|
|||
})?;
|
||||
|
||||
let wayland_config = WaylandSurfaceConfig::from_domain_config(
|
||||
&definition.component,
|
||||
component_definition,
|
||||
Some(Rc::clone(&compilation_result)),
|
||||
definition.config.clone(),
|
||||
|
|
@ -430,6 +431,7 @@ impl Shell {
|
|||
})?;
|
||||
|
||||
let wayland_config = WaylandSurfaceConfig::from_domain_config(
|
||||
&def.component,
|
||||
component_definition,
|
||||
Some(Rc::clone(&compilation_result)),
|
||||
def.config.clone(),
|
||||
|
|
|
|||
|
|
@ -566,6 +566,7 @@ impl SingleWindowShell {
|
|||
config: SurfaceConfig,
|
||||
) -> Result<Self> {
|
||||
let wayland_config = WaylandSurfaceConfig::from_domain_config(
|
||||
"default",
|
||||
component_definition,
|
||||
compilation_result,
|
||||
config,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue