-
-
Notifications
You must be signed in to change notification settings - Fork 838
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
click-to-focus on window should focus the pane under the mouse cursor #881
Comments
I looked at this a bit tonight; on macOS at least, the click that focuses the window isn't reported as a mouse event. This is potentially tricky; the internal focus event plumbing needs to include/infer information about the focus event so that we don't do something annoying like implicitly focusing the pane that was under the mouse prior to CMD-tabing away and back again, but does focus the the pane under the mouse when the focus was due to a mouse click. |
It looks like you might be able to set acceptsFirstMouse on an NSView to get it to show up as an event: https://developer.apple.com/documentation/appkit/nsview/1483410-acceptsfirstmouse/. I took a brief look at the code and immediately got very very lost, but I think something similar to what you did with accepts_first_responder would be how it would need to be done in https://github.com/wez/wezterm/blob/main/window/src/os/macos/window.rs |
Thanks for the lead! I've pushed a commit that implements this. The mac builds typically take about 30 minutes to build out after a push; please try it when it's built and let me know how well this works for you! |
I just did a quick test with nightly and it appears to work perfectly. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Discussed in #880
Originally posted by mivok June 17, 2021
Hi.
I currently have wezterm running with multiple panes in a single window. If I have another window focused, and click on the wezterm window, but over an inactive pane, I need to click a second time in order to focus the pane as well. Is it possible to have the pane be immediately focused on the first click that activates the window?
I do have
pane_focus_follows_mouse = true
, which almost does what I want. Unfortunately, if I click the window to focus it, and don't also move the mouse after clicking, then the pane under the cursor never actually gets focused. I also haveswallow_mouse_click_on_pane_focus = false
(or rather I have it left at the default), but that doesn't appear to be what I'm looking for either.The text was updated successfully, but these errors were encountered: