Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MacOS] Kitty grabs focus in split fullscreen unexpectedly #1803

Closed
DazWorrall opened this issue Jul 15, 2019 · 13 comments
Closed

[MacOS] Kitty grabs focus in split fullscreen unexpectedly #1803

DazWorrall opened this issue Jul 15, 2019 · 13 comments

Comments

@DazWorrall
Copy link

If 2 windows - A and B - share a native fullscreen desktop on MacOS, the window with focus is preserved as you switch to and from that desktop. E.g. if you're typing something into window A, switch to another desktop to copy some text and switch back, you can hit paste and have the contents land exactly where you left your cursor. If kitty is one of those windows it will always grab focus when returning to the split view. The previous example is a real life one for me and several times I've pasted something I didnt mean to into my shell!

Using 0.14.2.

@Luflosi
Copy link
Contributor

Luflosi commented Jul 15, 2019

I cannot reproduce the issue. Here is what I tried:

  1. Open kitty and Sublime Text
  2. Make the two windows fullscreen and make them share a fullscreen desktop with split-view
  3. Focus Sublime Text, this unfocuses kitty
  4. Use a multitouch gesture to switch to a desktop with no windows
  5. Use a multitouch gesture to switch back
  6. Sublime Text has focus, not kitty

@DazWorrall
Copy link
Author

Weird 🤔I'll give everything a reboot at the next opportunity and see if it persists. Here's a gif for posterity. I can only replicate this with kitty.

2019-07-15 at 11 42

@Luflosi
Copy link
Contributor

Luflosi commented Jul 15, 2019

Try starting kitty with kitty.app/Contents/MacOS/kitty --config NONE and see is that fixes the issue. If it does, something in your config is causing it and you can find out what is.

@DazWorrall
Copy link
Author

Ok, having played around I know what this is - I'm switching away to another kitty window on the next desktop. This takes focus, then when I return to the split view kitty is actually retaining the focus it got from the next window. This is probably a MacOS thing, sorry to bother.

@Luflosi
Copy link
Contributor

Luflosi commented Jul 15, 2019

That's weird, even when I have another kitty window open on the second desktop, kitty still doesn't have focus when I switch back.

@DazWorrall
Copy link
Author

Is the other kitty window a separate instance of the app?

Grr, just invalidated my previous theory while writing this comment. I switch the other way to Slack while typing here, switch back and kitty has focus again 🤔

@DazWorrall DazWorrall reopened this Jul 15, 2019
@Luflosi
Copy link
Contributor

Luflosi commented Jul 15, 2019

Did you try the --config NONE thing?

@DazWorrall
Copy link
Author

I did, but perhaps not rigorously enough. Trying again with a more systematic approach.

@DazWorrall
Copy link
Author

DazWorrall commented Jul 15, 2019

Desktop setup is [ Slack ] | [ Chrome + kitty ] [ kitty ]. Result is what happens when switching back:

Action My Config No Config
Focus chrome, switch to Slack Kitty takes focus
Focus chrome, switch to fullscreen kitty Kitty takes focus Kitty takes focus
Focus kitty, switch to Slack
Focus kitty, switch to fullscreen kitty

✅ = On return, same app has focus
Fullscreen kitty created with CMD+N.

Something in my config is causing that first focus theft then, I'll try and figure that out. Current config

$ egrep -v '^(#|$)' ~/.config/kitty/kitty.conf 
font_family      Monaco
font_size 12.0
open_url_modifiers cmd
copy_on_select yes
select_by_word_characters @-./_~?&%+#
sync_to_monitor no
enable_audio_bell no
enabled_layouts vertical,fat:bias=70,grid
inactive_text_alpha 0.6
macos_option_as_alt no
macos_quit_when_last_window_closed yes
macos_thicken_font 0.75
kitty_mod alt+shift
map shift+page_up   scroll_page_up
map shift+page_down scroll_page_down
map shift+cmd+enter kitten zoom_toggle.py
map cmd+w scroll_end
map alt+left send_text normal \x1bb
map alt+right send_text normal \x1bf

@Luflosi
Copy link
Contributor

Luflosi commented Sep 12, 2019

Did you figure anything out?

@eldh
Copy link

eldh commented Sep 26, 2019

I had the same problem. Removing open_url_modifiers cmd from my config seems to have fixed it, I think.

@Luflosi
Copy link
Contributor

Luflosi commented Sep 29, 2019

@DazWorrall I couldn't reproduce the issue with your config file. Can you try to figure out which config option is responsible for your issue? After looking at the code of open_url_modifiers, I couldn't find anything that could be causing this behaviour. A video of the issue could also be helpful.

@kovidgoyal
Copy link
Owner

no followup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants