Root: centralize focus(null) calls in applyPending()

This commit is contained in:
Isaac Freund
2023-03-01 10:49:44 +01:00
parent 07154720fa
commit 6411c71151
11 changed files with 21 additions and 39 deletions

View File

@ -43,7 +43,6 @@ pub fn focusOutput(
}
seat.focusOutput((try getOutput(seat, args[1])) orelse return);
seat.focus(null);
server.root.applyPending();
}
@ -68,8 +67,6 @@ pub fn sendToOutput(
if (seat.focused.view.pending.output == destination_output) return;
seat.focused.view.setPendingOutput(destination_output);
// Handle the change and focus whatever's next in the focus stack
seat.focus(null);
server.root.applyPending();
}
}

View File

@ -34,7 +34,6 @@ pub fn setFocusedTags(
if (output.pending.tags != tags) {
output.previous_tags = output.pending.tags;
output.pending.tags = tags;
seat.focus(null);
server.root.applyPending();
}
}
@ -58,7 +57,6 @@ pub fn setViewTags(
if (seat.focused == .view) {
const view = seat.focused.view;
view.pending.tags = tags;
seat.focus(null);
server.root.applyPending();
}
}
@ -75,7 +73,6 @@ pub fn toggleFocusedTags(
if (new_focused_tags != 0) {
output.previous_tags = output.pending.tags;
output.pending.tags = new_focused_tags;
seat.focus(null);
server.root.applyPending();
}
}
@ -92,7 +89,6 @@ pub fn toggleViewTags(
if (new_tags != 0) {
const view = seat.focused.view;
view.pending.tags = new_tags;
seat.focus(null);
server.root.applyPending();
}
}
@ -110,7 +106,6 @@ pub fn focusPreviousTags(
if (output.pending.tags != previous_tags) {
output.previous_tags = output.pending.tags;
output.pending.tags = previous_tags;
seat.focus(null);
server.root.applyPending();
}
}
@ -127,7 +122,6 @@ pub fn sendToPreviousTags(
if (seat.focused == .view) {
const view = seat.focused.view;
view.pending.tags = output.previous_tags;
seat.focus(null);
server.root.applyPending();
}
}

View File

@ -33,9 +33,6 @@ pub fn toggleFullscreen(
const view = seat.focused.view;
view.pending.fullscreen = !view.pending.fullscreen;
// It is possible to end up with multiple fullscreen views in which
// case making one non-fullscreen should switch focus to the next.
seat.focus(null);
server.root.applyPending();
}
}