Add focus_follows_drop option to focus window on drop done#9896
Add focus_follows_drop option to focus window on drop done#9896cxa wants to merge 1 commit intokovidgoyal:masterfrom
Conversation
|
I am not at all sure this is desired behavior, unless |
|
I tried |
|
Yeah but other people will find focus_follows_drop annoying. As I said For example, on macOS, drag and drop from focused finder does not |
1de014e to
58f9c66
Compare
Add a new `focus_follows_drop` option (default: no) that, when enabled, automatically focuses the window a file is dropped onto in split layouts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
58f9c66 to
f33117d
Compare
|
OK you convinced me. Let’s add an option ( |
|
|
Thanks for supporting this option! |
Add a new
focus_follows_dropoption (default:no) that, when enabled, automatically focuses the window that receives a drop.The problem
When using splits, dropping something onto a non-active window delivers the drop content correctly (via
window.on_drop()), but keyboard focus remains on the previously active window. The user has to manually click the target window after every drag-and-drop to continue working in it.The fix
A new boolean option
focus_follows_drop(default:no). When enabled,tab.set_active_window(window)is called beforewindow.on_drop(drop)inBoss.on_drop(), so the window that receives the drop also receives keyboard focus.What's changed
kitty/options/definition.py— newfocus_follows_dropoptionkitty/options/types.py— generated type entrykitty/boss.py— guardset_active_windowbehindget_options().focus_follows_dropWhat's NOT affected
application/net.kovidgoyal.kitty-tab-*path) — unchangedapplication/net.kovidgoyal.kitty-window-*path) — unchangedwindow is not tab.active_windowmakes this a no-opfocus_follows_dropdefaults tono)Testing
focus_follows_drop yestokitty.conf