focus: Restore nested popup grabs
This commit is contained in:
parent
724a4170df
commit
781427a74c
1 changed files with 25 additions and 0 deletions
|
|
@ -280,6 +280,31 @@ impl Common {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
if let KeyboardFocusTarget::Popup(_) = target {
|
||||||
|
if let Some(popup_grab) = seat
|
||||||
|
.user_data()
|
||||||
|
.get::<PopupGrabData>()
|
||||||
|
.and_then(|x| x.take())
|
||||||
|
{
|
||||||
|
if !popup_grab.has_ended() {
|
||||||
|
if let Some(new) = popup_grab.current_grab() {
|
||||||
|
trace!("restore focus to previous popup grab");
|
||||||
|
if let Some(keyboard) = seat.get_keyboard() {
|
||||||
|
keyboard.set_focus(
|
||||||
|
state,
|
||||||
|
Some(new.clone()),
|
||||||
|
SERIAL_COUNTER.next_serial(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
ActiveFocus::set(&seat, Some(new));
|
||||||
|
seat.user_data()
|
||||||
|
.get_or_insert::<PopupGrabData, _>(PopupGrabData::default)
|
||||||
|
.set(Some(popup_grab));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
trace!("Surface dead, focus fixup");
|
trace!("Surface dead, focus fixup");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue