You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had look into this and I can offer a bit more information.
Clarification
In most cases, the current default behavior of the various swap_window* commands is already doing what this feature request is asking: The focus follows then moved window.
Exception
The one case I could find where this is not true, is when focus-follows-mouse is enabled in the OS settings. Apologies that I didn't catch this earlier (I am so used to this setting, that I didn't think about that this may be the culprit). So instead of a feature request, this should have been a bug report.
Fix
In the simplest case, this can be fixed by actively focusing the moved window with window.Focus() after it has been moved. However, this fails when the move triggers any resizing among other windows (e.g., on the old monitor after move_window_to_monitor). In this case, the resizing may move another window underneath the mouse cursor, snatching the focus away again.
I played around a bit, and one somewhat hacky fix is to delay the window.Focus() by a few hundred milliseconds:
This seems to do the trick based on my initial testing but it definitely feels hacky. A cleaner solution might be to also move the mouse pointer to the center of the moved window.
Current behavior is to swap window position, but keep the current window focused.
swap_and_focus_window.left
swap_and_focus_window.right
swap_and_focus_window.up
swap_and_focus_window.down
move_and_focus_window.next_monitor
move_and_focus_window.previous_monitor
The text was updated successfully, but these errors were encountered: