leftwm icon indicating copy to clipboard operation
leftwm copied to clipboard

Focus disappears when removing several windows at a time

Open FrBst opened this issue 1 year ago • 4 comments

Describe the bug

When sloppy_mouse_follows_focus = false or focus_behaviour = driven. If I try to create and then close multiple windows while mouse cursor stays on another window or on a screen border, focus disappears after removing two of the windows. After that, FocusWindow and CloseWindow bindings do not work until I move mouse to refocus a window or switch workspaces.

System journal doesn't have any errors.

Expected behavior (optional)

No response

Steps to reproduce (optional)

Source code from tag 0.5.1, config file from examples/config-with-comments.ron, and same happened on master

  1. Set sloppy_mouse_follows_focus: false
  2. Move mouse to the left side of the screen and open multiple terminals repeatedly
  3. Try to close the terminals using keybinding, focus should disappear after closing second window

Relevant log output (optional)

No response

OS / Distro

Arch linux

Additional System Information (optional)

Built from source, git tag `0.5.1`

LeftWM Check

:: LeftWM version: 0.5.1
:: LeftWM git hash: 0.5.1
:: Enabled features:  journald-log lefthk
:: Checking feature dependencies . . .
    -> journald-log OK
    -> lefthk OK
:: Checking for leftwm binaries . . .
    -> Binaries OK
:: Loading configuration . . .
    -> Configuration loaded OK
:: Checking keybinds . . .
    -> All keybinds OK
:: Checking environment . . .
    -> Environment OK
:: Checking theme . . .
ERROR: No theme folder or symlink `current` found.

FrBst avatar Jan 02 '24 09:01 FrBst

I have a similar problem: if I have emacsclient and alacritty open in the same tag, with focus on the emacsclient, and I close the emacsclient, the focus is lost, even though there is only one remaining window in the tag.

I am using ClickTo and so the only way to regain focus is to click on the sole remaining window. FocusWindowUp and FocusWindowDown keybindings do nothing.

Interestingly, if I only use alacritty windows, and I close TWO of them then I similarly lose focus (like @FrBst says). If I only close one of them, then the focus is not lost.

barkyq avatar Jan 03 '24 22:01 barkyq

cf #1145 and #1108

barkyq avatar Jan 03 '24 22:01 barkyq

Exact same issue here!

paul-ohl avatar Apr 18 '24 16:04 paul-ohl

My workflow has been frustrated by this too. It seems to stem from the refocus behaviour; when you close a window, focus will move to the previously focused window. If you have closed the previously focused window, the logic gives up and doesn't focus on anything.

A similar thing happens when I change to a tag with multiple windows, then close the window I land on. Instead of changing focus to the remaining window, focus is lost altogether, presumably because the previously focused window is on a different tag.

Besides the fact that the current behaviour causes this bug, I find it generally inconvenient, for example if I'm working with multiple workspaces. Much more sensible in my mind would be for focus to simply move up the stack of the current workspace.

chaulkie avatar Apr 29 '24 03:04 chaulkie