mirror of
https://codeberg.org/waydeer/layer-shika.git
synced 2025-11-17 23:14:23 +00:00
chore: minor naming changes
This commit is contained in:
parent
ab47c3988b
commit
77ec18e8f8
3 changed files with 16 additions and 16 deletions
|
|
@ -11,7 +11,7 @@ use smithay_client_toolkit::reexports::protocols_wlr::layer_shell::v1::client::{
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
pub(crate) struct LayerSurfaceParams {
|
pub(crate) struct LayerSurfaceConfig {
|
||||||
pub anchor: Anchor,
|
pub anchor: Anchor,
|
||||||
pub margin: Margins,
|
pub margin: Margins,
|
||||||
pub exclusive_zone: i32,
|
pub exclusive_zone: i32,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::wayland::{
|
use crate::wayland::{
|
||||||
config::{LayerSurfaceParams, WaylandWindowConfig},
|
config::{LayerSurfaceConfig, WaylandWindowConfig},
|
||||||
globals::context::GlobalContext,
|
globals::context::GlobalContext,
|
||||||
surfaces::layer_surface::{SurfaceCtx, SurfaceSetupParams},
|
surfaces::layer_surface::{SurfaceCtx, SurfaceSetupParams},
|
||||||
surfaces::popup_manager::{PopupContext, PopupManager},
|
surfaces::popup_manager::{PopupContext, PopupManager},
|
||||||
|
|
@ -103,7 +103,7 @@ impl WaylandWindowingSystem {
|
||||||
) -> Result<(WindowState, GlobalContext, Rc<CustomSlintPlatform>)> {
|
) -> Result<(WindowState, GlobalContext, Rc<CustomSlintPlatform>)> {
|
||||||
let global_ctx = GlobalContext::initialize(connection, &event_queue.handle())?;
|
let global_ctx = GlobalContext::initialize(connection, &event_queue.handle())?;
|
||||||
|
|
||||||
let layer_surface_params = LayerSurfaceParams {
|
let layer_surface_config = LayerSurfaceConfig {
|
||||||
anchor: config.anchor,
|
anchor: config.anchor,
|
||||||
margin: config.margin,
|
margin: config.margin,
|
||||||
exclusive_zone: config.exclusive_zone,
|
exclusive_zone: config.exclusive_zone,
|
||||||
|
|
@ -122,7 +122,7 @@ impl WaylandWindowingSystem {
|
||||||
namespace: config.namespace.clone(),
|
namespace: config.namespace.clone(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let surface_ctx = SurfaceCtx::setup(&setup_params, &layer_surface_params);
|
let surface_ctx = SurfaceCtx::setup(&setup_params, &layer_surface_config);
|
||||||
|
|
||||||
let window =
|
let window =
|
||||||
Self::initialize_renderer(&surface_ctx.surface, &connection.display(), &config)?;
|
Self::initialize_renderer(&surface_ctx.surface, &connection.display(), &config)?;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::wayland::{config::LayerSurfaceParams, surfaces::surface_state::WindowState};
|
use crate::wayland::{config::LayerSurfaceConfig, surfaces::surface_state::WindowState};
|
||||||
use log::info;
|
use log::info;
|
||||||
use smithay_client_toolkit::reexports::protocols_wlr::layer_shell::v1::client::{
|
use smithay_client_toolkit::reexports::protocols_wlr::layer_shell::v1::client::{
|
||||||
zwlr_layer_shell_v1::{Layer, ZwlrLayerShellV1},
|
zwlr_layer_shell_v1::{Layer, ZwlrLayerShellV1},
|
||||||
|
|
@ -38,7 +38,7 @@ pub struct SurfaceCtx {
|
||||||
impl SurfaceCtx {
|
impl SurfaceCtx {
|
||||||
pub(crate) fn setup(
|
pub(crate) fn setup(
|
||||||
setup_params: &SurfaceSetupParams<'_>,
|
setup_params: &SurfaceSetupParams<'_>,
|
||||||
params: &LayerSurfaceParams,
|
config: &LayerSurfaceConfig,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let surface = Rc::new(
|
let surface = Rc::new(
|
||||||
setup_params
|
setup_params
|
||||||
|
|
@ -64,7 +64,7 @@ impl SurfaceCtx {
|
||||||
Rc::new(vp.get_viewport(&surface, setup_params.queue_handle, ()))
|
Rc::new(vp.get_viewport(&surface, setup_params.queue_handle, ()))
|
||||||
});
|
});
|
||||||
|
|
||||||
Self::configure_layer_surface(&layer_surface, &surface, params);
|
Self::configure_layer_surface(&layer_surface, &surface, config);
|
||||||
surface.set_buffer_scale(1);
|
surface.set_buffer_scale(1);
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
|
|
@ -78,19 +78,19 @@ impl SurfaceCtx {
|
||||||
fn configure_layer_surface(
|
fn configure_layer_surface(
|
||||||
layer_surface: &Rc<ZwlrLayerSurfaceV1>,
|
layer_surface: &Rc<ZwlrLayerSurfaceV1>,
|
||||||
surface: &WlSurface,
|
surface: &WlSurface,
|
||||||
params: &LayerSurfaceParams,
|
config: &LayerSurfaceConfig,
|
||||||
) {
|
) {
|
||||||
layer_surface.set_anchor(params.anchor);
|
layer_surface.set_anchor(config.anchor);
|
||||||
layer_surface.set_margin(
|
layer_surface.set_margin(
|
||||||
params.margin.top,
|
config.margin.top,
|
||||||
params.margin.right,
|
config.margin.right,
|
||||||
params.margin.bottom,
|
config.margin.bottom,
|
||||||
params.margin.left,
|
config.margin.left,
|
||||||
);
|
);
|
||||||
|
|
||||||
layer_surface.set_exclusive_zone(params.exclusive_zone);
|
layer_surface.set_exclusive_zone(config.exclusive_zone);
|
||||||
layer_surface.set_keyboard_interactivity(params.keyboard_interactivity);
|
layer_surface.set_keyboard_interactivity(config.keyboard_interactivity);
|
||||||
layer_surface.set_size(1, params.height);
|
layer_surface.set_size(1, config.height);
|
||||||
surface.commit();
|
surface.commit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue