shell: handle xdg/layer globals
This commit is contained in:
parent
e0da1e779b
commit
e7ecfc8903
6 changed files with 307 additions and 6 deletions
41
src/state.rs
41
src/state.rs
|
|
@ -1,12 +1,30 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use crate::{backend::x11::X11State, shell::workspaces::Workspaces};
|
||||
use smithay::reexports::wayland_server::Display;
|
||||
use crate::{
|
||||
backend::x11::X11State,
|
||||
shell::{init_shell, workspaces::Workspaces, ShellStates},
|
||||
};
|
||||
use smithay::{
|
||||
reexports::wayland_server::Display,
|
||||
wayland::{
|
||||
data_device::{default_action_chooser, init_data_device},
|
||||
output::xdg::init_xdg_output_manager,
|
||||
seat::Seat,
|
||||
shell::xdg::ToplevelSurface,
|
||||
shm::init_shm_global,
|
||||
},
|
||||
};
|
||||
use std::{cell::RefCell, rc::Rc, time::Instant};
|
||||
|
||||
pub struct State {
|
||||
pub display: Rc<RefCell<Display>>,
|
||||
|
||||
pub spaces: Workspaces,
|
||||
pub shell: ShellStates,
|
||||
pub pending_toplevels: Vec<ToplevelSurface>,
|
||||
|
||||
pub seats: Vec<Seat>,
|
||||
pub last_active_seat: Seat,
|
||||
|
||||
pub start_time: Instant,
|
||||
pub should_stop: bool,
|
||||
|
|
@ -31,10 +49,27 @@ impl BackendData {
|
|||
}
|
||||
|
||||
impl State {
|
||||
pub fn new(display: Display) -> State {
|
||||
pub fn new(mut display: Display) -> State {
|
||||
init_shm_global(&mut display, vec![], None);
|
||||
init_xdg_output_manager(&mut display, None);
|
||||
let shell_handles = init_shell(&mut display);
|
||||
let initial_seat = crate::input::add_seat(&mut display, "seat-0".into());
|
||||
init_data_device(
|
||||
&mut display,
|
||||
|_dnd_event| { /* TODO */ },
|
||||
default_action_chooser,
|
||||
None,
|
||||
);
|
||||
|
||||
State {
|
||||
display: Rc::new(RefCell::new(display)),
|
||||
|
||||
spaces: Workspaces::new(),
|
||||
shell: shell_handles,
|
||||
pending_toplevels: Vec::new(),
|
||||
|
||||
seats: vec![initial_seat.clone()],
|
||||
last_active_seat: initial_seat,
|
||||
|
||||
start_time: Instant::now(),
|
||||
should_stop: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue