support resizing, start on layer shell support
This commit is contained in:
parent
9268cb0220
commit
eea1406bd4
5 changed files with 257 additions and 19 deletions
30
src/handlers/wlr_layer_shell.rs
Normal file
30
src/handlers/wlr_layer_shell.rs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
use smithay::{
|
||||
desktop::{layer_map_for_output, LayerSurface},
|
||||
output::Output,
|
||||
wayland::shell::wlr_layer::WlrLayerShellHandler,
|
||||
};
|
||||
use wayland_server::protocol::wl_output::WlOutput;
|
||||
|
||||
use crate::State;
|
||||
|
||||
impl WlrLayerShellHandler for State {
|
||||
fn shell_state(&mut self) -> &mut smithay::wayland::shell::wlr_layer::WlrLayerShellState {
|
||||
&mut self.wlr_layer_shell_state
|
||||
}
|
||||
|
||||
fn new_layer_surface(
|
||||
&mut self,
|
||||
surface: smithay::wayland::shell::wlr_layer::LayerSurface,
|
||||
output: Option<WlOutput>,
|
||||
layer: smithay::wayland::shell::wlr_layer::Layer,
|
||||
namespace: String,
|
||||
) {
|
||||
let output = output
|
||||
.as_ref()
|
||||
.and_then(Output::from_resource)
|
||||
.unwrap_or_else(|| self.space.outputs().next().unwrap().clone());
|
||||
let mut map = layer_map_for_output(&output);
|
||||
map.map_layer(&LayerSurface::new(surface, namespace))
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue