shell: Correctly handle maximized stacks on move requests
This commit is contained in:
parent
e63921a1f6
commit
fce9691947
1 changed files with 95 additions and 90 deletions
|
|
@ -3424,12 +3424,14 @@ impl Shell {
|
|||
return None;
|
||||
}
|
||||
|
||||
if !move_out_of_stack {
|
||||
for workspace in self.workspaces.spaces_mut() {
|
||||
for seat in self.seats.iter() {
|
||||
let mut stack = workspace.focus_stack.get_mut(seat);
|
||||
stack.remove(&old_mapped);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let (window, _) = old_mapped
|
||||
.windows()
|
||||
|
|
@ -3439,6 +3441,9 @@ impl Shell {
|
|||
let mapped = if move_out_of_stack {
|
||||
let new_mapped: CosmicMapped =
|
||||
CosmicWindow::new(window.clone(), evlh.clone(), self.theme.clone()).into();
|
||||
if old_mapped.is_maximized(false) {
|
||||
new_mapped.set_maximized(false);
|
||||
}
|
||||
start_data.set_focus(new_mapped.focus_under((0., 0.).into(), WindowSurfaceType::ALL));
|
||||
new_mapped
|
||||
} else {
|
||||
|
|
@ -3475,16 +3480,15 @@ impl Shell {
|
|||
seat.active_output()
|
||||
};
|
||||
|
||||
let (initial_window_location, layer, workspace_handle) = if let Some(workspace) =
|
||||
self.space_for_mut(&old_mapped)
|
||||
{
|
||||
let (initial_window_location, layer, workspace_handle) =
|
||||
if let Some(workspace) = self.space_for_mut(&old_mapped) {
|
||||
let elem_geo = element_geo.or_else(|| workspace.element_geometry(&old_mapped))?;
|
||||
let mut initial_window_location = elem_geo.loc.to_global(workspace.output());
|
||||
|
||||
let mut new_size = if mapped.maximized_state.lock().unwrap().is_some() {
|
||||
let mut new_size = if old_mapped.maximized_state.lock().unwrap().is_some() {
|
||||
// If surface is maximized then unmaximize it
|
||||
workspace
|
||||
.unmaximize_request(&mapped)
|
||||
.unmaximize_request(&old_mapped)
|
||||
.map(|geo| geo.size.as_logical())
|
||||
} else {
|
||||
None
|
||||
|
|
@ -3532,9 +3536,10 @@ impl Shell {
|
|||
let elem_geo = sticky_layer.element_geometry(&old_mapped).unwrap();
|
||||
let mut initial_window_location = elem_geo.loc.to_global(&cursor_output);
|
||||
|
||||
let mut new_size = if let Some(state) = mapped.maximized_state.lock().unwrap().take() {
|
||||
let mut new_size =
|
||||
if let Some(state) = old_mapped.maximized_state.lock().unwrap().take() {
|
||||
// If surface is maximized then unmaximize it
|
||||
mapped.set_maximized(false);
|
||||
old_mapped.set_maximized(false);
|
||||
let new_size = state.original_geometry.size.as_logical();
|
||||
sticky_layer.map_internal(
|
||||
mapped.clone(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue