fix: ensure X window focus on unmap/map
This commit is contained in:
parent
44de3063ee
commit
5ce21fb4f3
3 changed files with 25 additions and 2 deletions
|
|
@ -212,6 +212,29 @@ impl Shell {
|
|||
state.common.shell.write().update_active();
|
||||
}
|
||||
|
||||
// We suppress Element(X) to Fullscreen(X) transition to avoid
|
||||
// loss of focus by the X window when having a transition to fullscreen
|
||||
// but in the case of X11 unmap/map the leave/enter needs to happen for the X11
|
||||
// internal state to be focused on the window
|
||||
pub fn set_focus_on_x11_map(
|
||||
state: &mut State,
|
||||
target: &KeyboardFocusTarget,
|
||||
seat: &Seat<State>,
|
||||
update_cursor: bool,
|
||||
) {
|
||||
let need_reset = seat
|
||||
.get_keyboard()
|
||||
.and_then(|keyboard| keyboard.current_focus())
|
||||
.and_then(|current| current.x11_surface())
|
||||
.is_some_and(|current| Some(current) == target.x11_surface());
|
||||
|
||||
if need_reset {
|
||||
update_focus_state(seat, None, state, None, false);
|
||||
}
|
||||
|
||||
Shell::set_focus(state, Some(target), seat, None, update_cursor);
|
||||
}
|
||||
|
||||
pub fn append_focus_stack(&mut self, target: impl Into<FocusTarget>, seat: &Seat<State>) {
|
||||
let target = target.into();
|
||||
if target.is_minimized() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue