toplevel-info/mgmt: Update to v2/v3
This commit is contained in:
parent
bbda6fb13d
commit
9c7c41c508
11 changed files with 270 additions and 119 deletions
|
|
@ -228,6 +228,34 @@ impl ToplevelManagementHandler for State {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn set_sticky(&mut self, _dh: &DisplayHandle, window: &<Self as ToplevelInfoHandler>::Window) {
|
||||
if window.is_sticky() {
|
||||
return;
|
||||
}
|
||||
|
||||
let mut shell = self.common.shell.write().unwrap();
|
||||
if let Some(mapped) = shell.element_for_surface(window).cloned() {
|
||||
let seat = shell.seats.last_active().clone();
|
||||
shell.toggle_sticky(&seat, &mapped);
|
||||
}
|
||||
}
|
||||
|
||||
fn unset_sticky(
|
||||
&mut self,
|
||||
_dh: &DisplayHandle,
|
||||
window: &<Self as ToplevelInfoHandler>::Window,
|
||||
) {
|
||||
if !window.is_sticky() {
|
||||
return;
|
||||
}
|
||||
|
||||
let mut shell = self.common.shell.write().unwrap();
|
||||
if let Some(mapped) = shell.element_for_surface(window).cloned() {
|
||||
let seat = shell.seats.last_active().clone();
|
||||
shell.toggle_sticky(&seat, &mapped);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ManagementWindow for CosmicSurface {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue