mirror of
https://github.com/gosticks/PaperWM.git
synced 2026-10-06 11:56:54 +00:00
Fix alignment when closing the very first or last window
There's very little delay between `focus` and `window-removed` so there's no jumpiness when running ensure twice.
This commit is contained in:
@@ -102,8 +102,8 @@ timestamp = () => {
|
||||
}
|
||||
|
||||
ensuring = false;
|
||||
ensure_viewport = (meta_window) => {
|
||||
if (ensuring == meta_window) {
|
||||
ensure_viewport = (meta_window, force) => {
|
||||
if (ensuring == meta_window && !force) {
|
||||
debug('already ensuring', meta_window.title);
|
||||
return;
|
||||
}
|
||||
@@ -255,8 +255,9 @@ remove_handler = (ws, meta_window) => {
|
||||
|
||||
// Re-layout: Needed if the removed window didn't have focus.
|
||||
// Not sure if we can check if that was the case or not?
|
||||
workspace[removed_i - 1].activate(timestamp());
|
||||
focus_handler(workspace[focus()])
|
||||
workspace[Math.max(0, removed_i - 1)].activate(timestamp());
|
||||
// Force a new ensure, since the focus_handler is run before window-removed
|
||||
ensure_viewport(workspace[focus()], true)
|
||||
}
|
||||
|
||||
add_all_from_workspace = (workspace) => {
|
||||
|
||||
Reference in New Issue
Block a user