stacks: Better handle minimize/unminimize of specific surface
This commit is contained in:
parent
14a9bd5579
commit
2bf769ac32
3 changed files with 23 additions and 6 deletions
|
|
@ -186,14 +186,19 @@ impl ToplevelManagementHandler for State {
|
|||
|
||||
fn minimize(&mut self, _dh: &DisplayHandle, window: &<Self as ToplevelInfoHandler>::Window) {
|
||||
if let Some(mapped) = self.common.shell.element_for_surface(window).cloned() {
|
||||
self.common.shell.minimize_request(&mapped);
|
||||
if !mapped.is_stack() || &mapped.active_window() == window {
|
||||
self.common.shell.minimize_request(&mapped);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn unminimize(&mut self, _dh: &DisplayHandle, window: &<Self as ToplevelInfoHandler>::Window) {
|
||||
if let Some(mapped) = self.common.shell.element_for_surface(window).cloned() {
|
||||
if let Some(mut mapped) = self.common.shell.element_for_surface(window).cloned() {
|
||||
let seat = self.common.last_active_seat().clone();
|
||||
self.common.shell.unminimize_request(&mapped, &seat);
|
||||
if mapped.is_stack() {
|
||||
mapped.stack_ref_mut().unwrap().set_active(window);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -172,7 +172,11 @@ impl XdgShellHandler for State {
|
|||
.element_for_wl_surface(surface.wl_surface())
|
||||
.cloned()
|
||||
{
|
||||
self.common.shell.minimize_request(&mapped)
|
||||
if !mapped.is_stack()
|
||||
|| mapped.active_window().wl_surface().as_ref() == Some(surface.wl_surface())
|
||||
{
|
||||
self.common.shell.minimize_request(&mapped)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue