refactor: fallback to last active seat for privileged activation token
This commit is contained in:
parent
e1aa8f7cb4
commit
cd5efd0741
1 changed files with 14 additions and 17 deletions
|
|
@ -42,23 +42,20 @@ impl XdgActivationHandler for State {
|
||||||
})
|
})
|
||||||
.unwrap_or(false)
|
.unwrap_or(false)
|
||||||
{
|
{
|
||||||
if let Some(seat) = data.serial.and_then(|(_, seat)| Seat::from_resource(&seat)) {
|
let seat = data
|
||||||
let output = seat.active_output();
|
.serial
|
||||||
let mut shell = self.common.shell.write();
|
.and_then(|(_, seat)| Seat::from_resource(&seat))
|
||||||
let workspace = shell.active_space_mut(&output).unwrap();
|
.unwrap_or_else(|| {
|
||||||
let handle = workspace.handle;
|
let shell = self.common.shell.read();
|
||||||
data.user_data
|
shell.seats.last_active().clone()
|
||||||
.insert_if_missing(move || ActivationContext::Workspace(handle));
|
});
|
||||||
debug!(?token, "created workspace token for privileged client");
|
let output = seat.active_output();
|
||||||
} else {
|
let mut shell = self.common.shell.write();
|
||||||
data.user_data
|
let workspace = shell.active_space_mut(&output).unwrap();
|
||||||
.insert_if_missing(|| ActivationContext::UrgentOnly);
|
let handle = workspace.handle;
|
||||||
debug!(
|
data.user_data
|
||||||
?token,
|
.insert_if_missing(move || ActivationContext::Workspace(handle));
|
||||||
"created urgent-only token for privileged client without seat"
|
debug!(?token, "created workspace token for privileged client");
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue