input: Move windows between workspaces

This commit is contained in:
Victoria Brekenfeld 2022-03-30 22:11:29 +02:00
parent 5b2ea80c50
commit f7ac9654d1
6 changed files with 38 additions and 4 deletions

View file

@ -48,7 +48,7 @@ impl<'a> FocusStackMut<'a> {
type FocusStackData = RefCell<(HashMap<u8, IndexSet<Window>>, IndexSet<Window>)>;
pub struct Workspace {
idx: u8,
pub(super) idx: u8,
pub space: Space,
pub(super) layout: Box<dyn Layout>,
pub(super) pending_windows: Vec<(Window, Seat)>,
@ -89,7 +89,7 @@ impl Workspace {
self.pending_windows.push((window, seat.clone()));
}
pub(super) fn map_window<'a>(&mut self, window: &Window, seat: &Seat) {
pub(super) fn map_window(&mut self, window: &Window, seat: &Seat) {
seat.user_data()
.insert_if_missing(|| FocusStackData::new((HashMap::new(), IndexSet::new())));
let focus_stack = FocusStackMut(RefMut::map(
@ -103,6 +103,10 @@ impl Workspace {
.map_window(&mut self.space, window, seat, focus_stack.iter())
}
pub(super) fn unmap_window(&mut self, window: &Window) {
self.layout.unmap_window(&mut self.space, window)
}
pub fn refresh(&mut self) {
self.layout.refresh(&mut self.space);
self.space.refresh();