focus: Better retain fullscreen focus
This commit is contained in:
parent
45bd385d9c
commit
173f2ae051
1 changed files with 16 additions and 5 deletions
|
|
@ -197,7 +197,9 @@ impl Common {
|
||||||
KeyboardFocusTarget::Element(mapped) => {
|
KeyboardFocusTarget::Element(mapped) => {
|
||||||
let workspace = state.common.shell.active_space(&output);
|
let workspace = state.common.shell.active_space(&output);
|
||||||
let focus_stack = workspace.focus_stack.get(&seat);
|
let focus_stack = workspace.focus_stack.get(&seat);
|
||||||
if focus_stack.last().map(|m| m == &mapped).unwrap_or(false) {
|
if focus_stack.last().map(|m| m == &mapped).unwrap_or(false)
|
||||||
|
&& workspace.get_fullscreen(&output).is_none()
|
||||||
|
{
|
||||||
continue; // Focus is valid
|
continue; // Focus is valid
|
||||||
} else {
|
} else {
|
||||||
slog_scope::debug!("Wrong Window, focus fixup");
|
slog_scope::debug!("Wrong Window, focus fixup");
|
||||||
|
|
@ -245,11 +247,20 @@ impl Common {
|
||||||
.common
|
.common
|
||||||
.shell
|
.shell
|
||||||
.active_space(&output)
|
.active_space(&output)
|
||||||
.focus_stack
|
.get_fullscreen(&output)
|
||||||
.get(&seat)
|
|
||||||
.last()
|
|
||||||
.cloned()
|
.cloned()
|
||||||
.map(KeyboardFocusTarget::from);
|
.map(KeyboardFocusTarget::Fullscreen)
|
||||||
|
.or_else(|| {
|
||||||
|
state
|
||||||
|
.common
|
||||||
|
.shell
|
||||||
|
.active_space(&output)
|
||||||
|
.focus_stack
|
||||||
|
.get(&seat)
|
||||||
|
.last()
|
||||||
|
.cloned()
|
||||||
|
.map(KeyboardFocusTarget::from)
|
||||||
|
});
|
||||||
if let Some(keyboard) = seat.get_keyboard() {
|
if let Some(keyboard) = seat.get_keyboard() {
|
||||||
slog_scope::info!("restoring focus to: {:?}", target.as_ref());
|
slog_scope::info!("restoring focus to: {:?}", target.as_ref());
|
||||||
keyboard.set_focus(state, target.clone(), SERIAL_COUNTER.next_serial());
|
keyboard.set_focus(state, target.clone(), SERIAL_COUNTER.next_serial());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue