fmt commit
This commit is contained in:
parent
352c526e9e
commit
9e0a6e1b5f
25 changed files with 787 additions and 499 deletions
|
|
@ -1,27 +1,31 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use crate::utils::prelude::*;
|
||||
use super::Shell;
|
||||
use crate::utils::prelude::*;
|
||||
|
||||
use cosmic_protocols::workspace::v1::server::zcosmic_workspace_handle_v1::State as WState;
|
||||
use smithay::{
|
||||
backend::renderer::{Renderer, ImportAll},
|
||||
desktop::{Kind, Window, draw_window, space::{RenderElement, SpaceOutputTuple}},
|
||||
backend::renderer::{ImportAll, Renderer},
|
||||
desktop::{
|
||||
draw_window,
|
||||
space::{RenderElement, SpaceOutputTuple},
|
||||
Kind, Window,
|
||||
},
|
||||
reexports::{
|
||||
wayland_protocols::xdg::shell::server::xdg_toplevel::State as XdgState,
|
||||
wayland_server::DisplayHandle,
|
||||
},
|
||||
utils::{IsAlive, Logical, Physical, Point, Rectangle, Scale},
|
||||
wayland::{
|
||||
output::Output,
|
||||
seat::{
|
||||
AxisFrame, ButtonEvent, MotionEvent, PointerGrab, PointerGrabStartData,
|
||||
PointerInnerHandle,
|
||||
},
|
||||
seat::{Seat, Focus},
|
||||
output::Output,
|
||||
seat::{Focus, Seat},
|
||||
Serial,
|
||||
},
|
||||
};
|
||||
use cosmic_protocols::workspace::v1::server::zcosmic_workspace_handle_v1::State as WState;
|
||||
use std::cell::RefCell;
|
||||
|
||||
impl Shell {
|
||||
|
|
@ -34,31 +38,37 @@ impl Shell {
|
|||
) {
|
||||
// TODO touch grab
|
||||
if let Some(pointer) = seat.get_pointer() {
|
||||
let workspace = self.space_for_window_mut(window.toplevel().wl_surface()).unwrap();
|
||||
let workspace = self
|
||||
.space_for_window_mut(window.toplevel().wl_surface())
|
||||
.unwrap();
|
||||
if workspace.fullscreen.values().any(|w| w == window) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
let pos = pointer.current_location();
|
||||
let output = workspace.space.outputs_for_window(&window)
|
||||
let output = workspace
|
||||
.space
|
||||
.outputs_for_window(&window)
|
||||
.into_iter()
|
||||
.find(|o| o.geometry().contains(pos.to_i32_round()))
|
||||
.unwrap();
|
||||
let mut initial_window_location = workspace.space.window_location(&window).unwrap();
|
||||
|
||||
|
||||
let output = match &window.toplevel() {
|
||||
Kind::Xdg(surface) => {
|
||||
// If surface is maximized then unmaximize it
|
||||
let current_state = surface.current_state();
|
||||
if current_state.states.contains(XdgState::Maximized) {
|
||||
workspace.floating_layer.unmaximize_request(&mut workspace.space, window);
|
||||
workspace
|
||||
.floating_layer
|
||||
.unmaximize_request(&mut workspace.space, window);
|
||||
let new_size = surface.with_pending_state(|state| state.size);
|
||||
let ratio = pos.x / output.geometry().size.w as f64;
|
||||
|
||||
initial_window_location = new_size.map(|size| (
|
||||
pos.x - (size.w as f64 * ratio),
|
||||
pos.y,
|
||||
).into()).unwrap_or_else(|| pos).to_i32_round();
|
||||
initial_window_location = new_size
|
||||
.map(|size| (pos.x - (size.w as f64 * ratio), pos.y).into())
|
||||
.unwrap_or_else(|| pos)
|
||||
.to_i32_round();
|
||||
}
|
||||
|
||||
output
|
||||
|
|
@ -67,8 +77,8 @@ impl Shell {
|
|||
|
||||
let was_tiled = if workspace.tiling_layer.windows.contains(&window) {
|
||||
workspace
|
||||
.tiling_layer
|
||||
.unmap_window(&mut workspace.space, &window);
|
||||
.tiling_layer
|
||||
.unmap_window(&mut workspace.space, &window);
|
||||
true
|
||||
} else {
|
||||
workspace
|
||||
|
|
@ -76,19 +86,20 @@ impl Shell {
|
|||
.unmap_window(&mut workspace.space, &window);
|
||||
false
|
||||
};
|
||||
|
||||
|
||||
let workspace_handle = workspace.handle;
|
||||
let workspace_is_empty = workspace.space.windows().next().is_none();
|
||||
|
||||
if workspace_is_empty {
|
||||
self.workspace_state.update().add_workspace_state(&workspace_handle, WState::Hidden);
|
||||
self.workspace_state
|
||||
.update()
|
||||
.add_workspace_state(&workspace_handle, WState::Hidden);
|
||||
}
|
||||
self.toplevel_info_state
|
||||
.toplevel_leave_workspace(&window, &workspace_handle);
|
||||
self.toplevel_info_state
|
||||
.toplevel_leave_output(&window, &output);
|
||||
|
||||
|
||||
|
||||
let state = MoveGrabState {
|
||||
window: window.clone(),
|
||||
was_tiled,
|
||||
|
|
@ -97,25 +108,30 @@ impl Shell {
|
|||
};
|
||||
let grab = MoveSurfaceGrab::new(start_data, window.clone(), seat);
|
||||
|
||||
*seat.user_data().get::<SeatMoveGrabState>().unwrap().borrow_mut() = Some(state);
|
||||
*seat
|
||||
.user_data()
|
||||
.get::<SeatMoveGrabState>()
|
||||
.unwrap()
|
||||
.borrow_mut() = Some(state);
|
||||
pointer.set_grab(grab, serial, Focus::Clear);
|
||||
}
|
||||
}
|
||||
|
||||
fn drop_move(
|
||||
&mut self,
|
||||
dh: &DisplayHandle,
|
||||
seat: &Seat<State>,
|
||||
|
||||
output: &Output,
|
||||
) {
|
||||
if let Some(move_state) = seat.user_data().get::<SeatMoveGrabState>().unwrap().borrow_mut().take() {
|
||||
fn drop_move(&mut self, dh: &DisplayHandle, seat: &Seat<State>, output: &Output) {
|
||||
if let Some(move_state) = seat
|
||||
.user_data()
|
||||
.get::<SeatMoveGrabState>()
|
||||
.unwrap()
|
||||
.borrow_mut()
|
||||
.take()
|
||||
{
|
||||
let pointer = seat.get_pointer().unwrap();
|
||||
let window = move_state.window;
|
||||
|
||||
|
||||
if window.alive() {
|
||||
let delta = pointer.current_location() - move_state.initial_cursor_location;
|
||||
let window_location = (move_state.initial_window_location.to_f64() + delta).to_i32_round();
|
||||
let window_location =
|
||||
(move_state.initial_window_location.to_f64() + delta).to_i32_round();
|
||||
let surface = window.toplevel().wl_surface().clone();
|
||||
|
||||
let workspace_handle = self.active_space(output).handle;
|
||||
|
|
@ -137,9 +153,12 @@ impl Shell {
|
|||
focus_stack.iter(),
|
||||
);
|
||||
} else {
|
||||
workspace
|
||||
.floating_layer
|
||||
.map_window(&mut workspace.space, window, &seat, window_location);
|
||||
workspace.floating_layer.map_window(
|
||||
&mut workspace.space,
|
||||
window,
|
||||
&seat,
|
||||
window_location,
|
||||
);
|
||||
}
|
||||
|
||||
self.set_focus(dh, Some(&surface), &seat, None);
|
||||
|
|
@ -175,14 +194,15 @@ where
|
|||
fn id(&self) -> usize {
|
||||
self.seat_id
|
||||
}
|
||||
|
||||
|
||||
fn location(&self, scale: impl Into<Scale<f64>>) -> Point<f64, Physical> {
|
||||
(self.window_location - self.window.geometry().loc.to_f64()).to_physical(scale)
|
||||
}
|
||||
|
||||
fn geometry(&self, scale: impl Into<Scale<f64>>) -> Rectangle<i32, Physical> {
|
||||
let scale = scale.into();
|
||||
self.window.physical_bbox_with_popups(RenderElement::<R>::location(self, scale), scale)
|
||||
self.window
|
||||
.physical_bbox_with_popups(RenderElement::<R>::location(self, scale), scale)
|
||||
}
|
||||
|
||||
fn accumulated_damage(
|
||||
|
|
@ -191,15 +211,20 @@ where
|
|||
for_values: Option<SpaceOutputTuple<'_, '_>>,
|
||||
) -> Vec<Rectangle<i32, Physical>> {
|
||||
let scale = scale.into();
|
||||
self.window.accumulated_damage(RenderElement::<R>::location(self, scale), scale, for_values.map(|t| (t.0, t.1)))
|
||||
self.window.accumulated_damage(
|
||||
RenderElement::<R>::location(self, scale),
|
||||
scale,
|
||||
for_values.map(|t| (t.0, t.1)),
|
||||
)
|
||||
}
|
||||
|
||||
fn opaque_regions(
|
||||
fn opaque_regions(
|
||||
&self,
|
||||
scale: impl Into<Scale<f64>>,
|
||||
) -> Option<Vec<Rectangle<i32, Physical>>> {
|
||||
let scale = scale.into();
|
||||
self.window.opaque_regions(RenderElement::<R>::location(self, scale), scale)
|
||||
self.window
|
||||
.opaque_regions(RenderElement::<R>::location(self, scale), scale)
|
||||
}
|
||||
|
||||
fn draw(
|
||||
|
|
@ -218,19 +243,20 @@ where
|
|||
impl MoveGrabState {
|
||||
pub fn render<I>(&self, seat: &Seat<State>, output: &Output) -> Option<I>
|
||||
where
|
||||
I: From<MoveGrabRenderElement>
|
||||
I: From<MoveGrabRenderElement>,
|
||||
{
|
||||
let cursor_at = seat.get_pointer().unwrap().current_location();
|
||||
let delta = cursor_at - self.initial_cursor_location;
|
||||
let mut window_geo = self.window.bbox();
|
||||
window_geo.loc += (self.initial_window_location.to_f64() + delta).to_i32_round();
|
||||
|
||||
|
||||
if !output.geometry().intersection(window_geo).is_some() {
|
||||
return None;
|
||||
}
|
||||
|
||||
let delta = cursor_at - self.initial_cursor_location;
|
||||
let window_location = self.initial_window_location.to_f64() + delta - output.geometry().loc.to_f64();
|
||||
let window_location =
|
||||
self.initial_window_location.to_f64() + delta - output.geometry().loc.to_f64();
|
||||
Some(I::from(MoveGrabRenderElement {
|
||||
seat_id: seat.id(),
|
||||
window: self.window.clone(),
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use smithay::{
|
|||
reexports::wayland_protocols::xdg::shell::server::xdg_toplevel::{
|
||||
ResizeEdge, State as XdgState,
|
||||
},
|
||||
utils::{IsAlive, Rectangle, Point, Logical},
|
||||
utils::{IsAlive, Logical, Point, Rectangle},
|
||||
wayland::{
|
||||
compositor::with_states,
|
||||
output::Output,
|
||||
|
|
@ -40,7 +40,13 @@ impl FloatingLayout {
|
|||
Default::default()
|
||||
}
|
||||
|
||||
pub fn map_window(&mut self, space: &mut Space, window: Window, seat: &Seat<State>, position: impl Into<Option<Point<i32, Logical>>>) {
|
||||
pub fn map_window(
|
||||
&mut self,
|
||||
space: &mut Space,
|
||||
window: Window,
|
||||
seat: &Seat<State>,
|
||||
position: impl Into<Option<Point<i32, Logical>>>,
|
||||
) {
|
||||
if let Some(output) = super::output_from_seat(Some(seat), space) {
|
||||
self.map_window_internal(space, window, &output, position.into());
|
||||
} else {
|
||||
|
|
@ -58,8 +64,17 @@ impl FloatingLayout {
|
|||
// TODO make sure all windows are still visible on any output or move them
|
||||
}
|
||||
|
||||
fn map_window_internal(&mut self, space: &mut Space, window: Window, output: &Output, position: Option<Point<i32, Logical>>) {
|
||||
let last_geometry = window.user_data().get::<WindowUserData>().map(|u| u.lock().unwrap().last_geometry);
|
||||
fn map_window_internal(
|
||||
&mut self,
|
||||
space: &mut Space,
|
||||
window: Window,
|
||||
output: &Output,
|
||||
position: Option<Point<i32, Logical>>,
|
||||
) {
|
||||
let last_geometry = window
|
||||
.user_data()
|
||||
.get::<WindowUserData>()
|
||||
.map(|u| u.lock().unwrap().last_geometry);
|
||||
let mut win_geo = window.geometry();
|
||||
|
||||
let layers = layer_map_for_output(&output);
|
||||
|
|
@ -112,10 +127,15 @@ impl FloatingLayout {
|
|||
}
|
||||
}
|
||||
|
||||
let position = position.or_else(|| last_geometry.map(|g| g.loc)).unwrap_or_else(|| (
|
||||
geometry.loc.x + (geometry.size.w / 2) - (win_geo.size.w / 2) + win_geo.loc.x,
|
||||
geometry.loc.y + (geometry.size.h / 2) - (win_geo.size.h / 2) + win_geo.loc.y,
|
||||
).into());
|
||||
let position = position
|
||||
.or_else(|| last_geometry.map(|g| g.loc))
|
||||
.unwrap_or_else(|| {
|
||||
(
|
||||
geometry.loc.x + (geometry.size.w / 2) - (win_geo.size.w / 2) + win_geo.loc.x,
|
||||
geometry.loc.y + (geometry.size.h / 2) - (win_geo.size.h / 2) + win_geo.loc.y,
|
||||
)
|
||||
.into()
|
||||
});
|
||||
|
||||
#[allow(irrefutable_let_patterns)]
|
||||
if let Kind::Xdg(xdg) = &window.toplevel() {
|
||||
|
|
@ -138,19 +158,21 @@ impl FloatingLayout {
|
|||
pub fn unmap_window(&mut self, space: &mut Space, window: &Window) {
|
||||
#[allow(irrefutable_let_patterns)]
|
||||
let is_maximized = match &window.toplevel() {
|
||||
Kind::Xdg(surface) => surface.with_pending_state(|state| {
|
||||
state.states.contains(XdgState::Maximized)
|
||||
})
|
||||
Kind::Xdg(surface) => {
|
||||
surface.with_pending_state(|state| state.states.contains(XdgState::Maximized))
|
||||
}
|
||||
};
|
||||
|
||||
if !is_maximized {
|
||||
if let Some(location) = space.window_location(window) {
|
||||
let user_data = window.user_data();
|
||||
user_data.insert_if_missing(|| WindowUserData::default());
|
||||
user_data.get::<WindowUserData>().unwrap().lock().unwrap().last_geometry = Rectangle::from_loc_and_size(
|
||||
location,
|
||||
window.geometry().size,
|
||||
);
|
||||
user_data
|
||||
.get::<WindowUserData>()
|
||||
.unwrap()
|
||||
.lock()
|
||||
.unwrap()
|
||||
.last_geometry = Rectangle::from_loc_and_size(location, window.geometry().size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -162,16 +184,18 @@ impl FloatingLayout {
|
|||
pub fn maximize_request(&mut self, space: &mut Space, window: &Window, output: &Output) {
|
||||
let layers = layer_map_for_output(&output);
|
||||
let geometry = layers.non_exclusive_zone();
|
||||
|
||||
|
||||
if let Some(location) = space.window_location(window) {
|
||||
let user_data = window.user_data();
|
||||
user_data.insert_if_missing(|| WindowUserData::default());
|
||||
user_data.get::<WindowUserData>().unwrap().lock().unwrap().last_geometry = Rectangle::from_loc_and_size(
|
||||
location,
|
||||
window.geometry().size,
|
||||
);
|
||||
user_data
|
||||
.get::<WindowUserData>()
|
||||
.unwrap()
|
||||
.lock()
|
||||
.unwrap()
|
||||
.last_geometry = Rectangle::from_loc_and_size(location, window.geometry().size);
|
||||
}
|
||||
|
||||
|
||||
space.map_window(
|
||||
&window,
|
||||
(geometry.loc.x, geometry.loc.y),
|
||||
|
|
@ -189,7 +213,10 @@ impl FloatingLayout {
|
|||
}
|
||||
|
||||
pub fn unmaximize_request(&mut self, space: &mut Space, window: &Window) {
|
||||
let last_geometry = window.user_data().get::<WindowUserData>().map(|u| u.lock().unwrap().last_geometry);
|
||||
let last_geometry = window
|
||||
.user_data()
|
||||
.get::<WindowUserData>()
|
||||
.map(|u| u.lock().unwrap().last_geometry);
|
||||
match window.toplevel() {
|
||||
Kind::Xdg(toplevel) => {
|
||||
toplevel.with_pending_state(|state| {
|
||||
|
|
@ -200,12 +227,7 @@ impl FloatingLayout {
|
|||
}
|
||||
}
|
||||
if let Some(last_location) = last_geometry.map(|g| g.loc) {
|
||||
space.map_window(
|
||||
&window,
|
||||
last_location,
|
||||
FLOATING_INDEX,
|
||||
true,
|
||||
);
|
||||
space.map_window(&window, last_location, FLOATING_INDEX, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ use crate::{
|
|||
utils::prelude::*,
|
||||
wayland::protocols::{
|
||||
toplevel_info::ToplevelInfoState,
|
||||
toplevel_management::{ToplevelManagementState, ManagementCapabilities},
|
||||
toplevel_management::{ManagementCapabilities, ToplevelManagementState},
|
||||
workspace::{
|
||||
WorkspaceCapabilities, WorkspaceGroupHandle, WorkspaceHandle, WorkspaceState,
|
||||
WorkspaceUpdateGuard,
|
||||
|
|
@ -36,8 +36,8 @@ use crate::{
|
|||
|
||||
pub const MAX_WORKSPACES: usize = 10;
|
||||
pub mod focus;
|
||||
pub mod layout;
|
||||
pub mod grabs;
|
||||
pub mod layout;
|
||||
mod workspace;
|
||||
pub use self::workspace::*;
|
||||
|
||||
|
|
@ -90,10 +90,14 @@ impl Shell {
|
|||
let toplevel_info_state = ToplevelInfoState::new(
|
||||
dh,
|
||||
//|client| client.get_data::<ClientState>().unwrap().privileged,
|
||||
|_| true);
|
||||
|_| true,
|
||||
);
|
||||
let toplevel_management_state = ToplevelManagementState::new::<State, _>(
|
||||
dh,
|
||||
vec![ManagementCapabilities::Close, ManagementCapabilities::Activate],
|
||||
vec![
|
||||
ManagementCapabilities::Close,
|
||||
ManagementCapabilities::Activate,
|
||||
],
|
||||
//|client| client.get_data::<ClientState>().unwrap().privileged,
|
||||
|_| true,
|
||||
);
|
||||
|
|
@ -461,20 +465,32 @@ impl Shell {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn outputs_for_surface<'a>(&'a self, surface: &'a WlSurface) -> impl Iterator<Item = Output> + 'a {
|
||||
pub fn outputs_for_surface<'a>(
|
||||
&'a self,
|
||||
surface: &'a WlSurface,
|
||||
) -> impl Iterator<Item = Output> + 'a {
|
||||
match self.outputs.iter().find(|o| {
|
||||
let map = layer_map_for_output(o);
|
||||
map.layer_for_surface(surface, WindowSurfaceType::ALL).is_some()
|
||||
map.layer_for_surface(surface, WindowSurfaceType::ALL)
|
||||
.is_some()
|
||||
}) {
|
||||
Some(output) => Box::new(std::iter::once(output.clone())) as Box<dyn Iterator<Item = Output>>,
|
||||
None => Box::new(self.spaces.iter().filter_map(|w| {
|
||||
if let Some(window) = w.space.window_for_surface(surface, WindowSurfaceType::ALL) {
|
||||
Some(w.space.outputs_for_window(&window).into_iter())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.flatten()),
|
||||
Some(output) => {
|
||||
Box::new(std::iter::once(output.clone())) as Box<dyn Iterator<Item = Output>>
|
||||
}
|
||||
None => Box::new(
|
||||
self.spaces
|
||||
.iter()
|
||||
.filter_map(|w| {
|
||||
if let Some(window) =
|
||||
w.space.window_for_surface(surface, WindowSurfaceType::ALL)
|
||||
{
|
||||
Some(w.space.outputs_for_window(&window).into_iter())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.flatten(),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -541,20 +557,31 @@ impl Shell {
|
|||
let workspace = &mut self.spaces[active];
|
||||
workspace.refresh(dh);
|
||||
if workspace.space.windows().next().is_none()
|
||||
&& !self.workspace_state.workspace_states(&workspace.handle).map(|mut i| i.any(|s| s == &WState::Hidden)).unwrap_or(true)
|
||||
&& !self
|
||||
.workspace_state
|
||||
.workspace_states(&workspace.handle)
|
||||
.map(|mut i| i.any(|s| s == &WState::Hidden))
|
||||
.unwrap_or(true)
|
||||
{
|
||||
self.workspace_state.update().add_workspace_state(&workspace.handle, WState::Hidden);
|
||||
self.workspace_state
|
||||
.update()
|
||||
.add_workspace_state(&workspace.handle, WState::Hidden);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
WorkspaceMode::Global { active, .. } => {
|
||||
let workspace = &mut self.spaces[*active];
|
||||
workspace.refresh(dh);
|
||||
if workspace.space.windows().next().is_none()
|
||||
&& !self.workspace_state.workspace_states(&workspace.handle).map(|mut i| i.any(|s| s == &WState::Hidden)).unwrap_or(true)
|
||||
&& !self
|
||||
.workspace_state
|
||||
.workspace_states(&workspace.handle)
|
||||
.map(|mut i| i.any(|s| s == &WState::Hidden))
|
||||
.unwrap_or(true)
|
||||
{
|
||||
self.workspace_state.update().add_workspace_state(&workspace.handle, WState::Hidden);
|
||||
self.workspace_state
|
||||
.update()
|
||||
.add_workspace_state(&workspace.handle, WState::Hidden);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -682,9 +709,12 @@ impl Shell {
|
|||
.toplevel_enter_workspace(&window, &new_workspace.handle);
|
||||
let focus_stack = new_workspace.focus_stack(&seat);
|
||||
if layout::should_be_floating(&window) {
|
||||
new_workspace
|
||||
.floating_layer
|
||||
.map_window(&mut new_workspace.space, window, &seat, None);
|
||||
new_workspace.floating_layer.map_window(
|
||||
&mut new_workspace.space,
|
||||
window,
|
||||
&seat,
|
||||
None,
|
||||
);
|
||||
} else {
|
||||
new_workspace.tiling_layer.map_window(
|
||||
&mut new_workspace.space,
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ impl Workspace {
|
|||
.maximize_request(&mut self.space, window, output);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pub fn unmaximize_request(&mut self, window: &Window) {
|
||||
if self.fullscreen.values().any(|w| w == window) {
|
||||
return self.unfullscreen_request(window);
|
||||
|
|
@ -173,14 +173,16 @@ impl Workspace {
|
|||
if self.tiling_enabled {
|
||||
for window in self.tiling_layer.windows.clone().into_iter() {
|
||||
self.tiling_layer.unmap_window(&mut self.space, &window);
|
||||
self.floating_layer.map_window(&mut self.space, window, seat, None);
|
||||
self.floating_layer
|
||||
.map_window(&mut self.space, window, seat, None);
|
||||
}
|
||||
self.tiling_enabled = false;
|
||||
} else {
|
||||
let focus_stack = self.focus_stack(seat);
|
||||
for window in self.floating_layer.windows.clone().into_iter() {
|
||||
self.floating_layer.unmap_window(&mut self.space, &window);
|
||||
self.tiling_layer.map_window(&mut self.space, window, seat, focus_stack.iter())
|
||||
self.tiling_layer
|
||||
.map_window(&mut self.space, window, seat, focus_stack.iter())
|
||||
}
|
||||
self.tiling_enabled = true;
|
||||
}
|
||||
|
|
@ -191,11 +193,13 @@ impl Workspace {
|
|||
if let Some(window) = self.focus_stack(seat).iter().next().cloned() {
|
||||
if self.tiling_layer.windows.contains(&window) {
|
||||
self.tiling_layer.unmap_window(&mut self.space, &window);
|
||||
self.floating_layer.map_window(&mut self.space, window, seat, None);
|
||||
self.floating_layer
|
||||
.map_window(&mut self.space, window, seat, None);
|
||||
} else if self.floating_layer.windows.contains(&window) {
|
||||
let focus_stack = self.focus_stack(seat);
|
||||
self.floating_layer.unmap_window(&mut self.space, &window);
|
||||
self.tiling_layer.map_window(&mut self.space, window, seat, focus_stack.iter())
|
||||
self.tiling_layer
|
||||
.map_window(&mut self.space, window, seat, focus_stack.iter())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue