kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
23.77k stars 959 forks source link

Activating Mission Control on MacOS when a Kitty window is in focus causes lag #6446

Closed westernwontons closed 1 year ago

westernwontons commented 1 year ago

Describe the bug I'm not entirely sure it's a bug, but this is something that I also noticed with Neovide. When Kitty is in focus and only when Kitty is in focus, activating mission control on MacOS makes the animations laggy. When Kitty is not in focus this is not observable. Additionally, the lag gets substantially less observable if the Kitty window is smaller.

To Reproduce Steps to reproduce the behavior:

  1. Open Kitty on MacOS (tried on Ventura only)
  2. Fullscreen Kitty if it's not already
  3. Activate Mission Control
  4. Notice the lag

Recording

https://github.com/kovidgoyal/kitty/assets/75550932/b44b4392-d6f4-4020-9098-e90c8fd355a0

Environment details

kitty 0.29.0 (e2b5c6688d) created by Kovid Goyal
Darwin bBook.local 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000 arm64
ProductName:        macOS ProductVersion:       13.4.1 BuildVersion:        22F82
Frozen: True
Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions
  system shell: /bin/zsh
Loaded config files:
  /Users/nagybotond/.config/kitty/kitty.conf

Config options different from defaults:
cursor_blink_interval      0.0
cursor_stop_blinking_after 0
disable_ligatures          1
enable_audio_bell          False
enabled_layouts            ['tall', 'fat', 'stack', 'grid']
font_family                JetBrainsMono Nerd Font Mono
font_size                  19.0
macos_show_window_title_in window
repaint_delay              5
scrollback_pager           ['nvim', '-c', 'lua local baleia = require("baleia").setup({}); baleia.once(0)', '-c', 'map <silent> q :qa!<CR>', '-c', '%s/\x1b]133;.*\x1b\\\\//e', '+INPUT_LINE_NUMBER']
shell_integration          frozenset({'invalid'})
strip_trailing_spaces      smart
tab_bar_edge               1
tab_bar_margin_height      TabBarMarginHeight(outer=0.5, inner=0.5)
tab_bar_margin_width       0.5
tab_bar_style              custom
window_border_width        (2.0, 'pt')
window_margin_width        FloatEdges(left=10.0, top=15.0, right=10.0, bottom=15.0)
window_padding_width       FloatEdges(left=6.0, top=6.0, right=6.0, bottom=6.0)
Added shortcuts:
    cmd+backspace →  send_text application \x15
    cmd+d →  new_window_with_cwd
    cmd+f →  goto_layout fat
    cmd+g →  goto_layout grid
    cmd+l →  goto_layout tall
    cmd+left →  send_text application \x01
    cmd+right →  send_text application \x05
    cmd+z →  toggle_layout stack
    ctrl+shift+opt+cmd+b →  move_window_backward
    ctrl+shift+opt+cmd+down →  next_tab
    ctrl+shift+opt+cmd+f →  move_window_forward
    ctrl+shift+opt+cmd+left →  previous_window
    ctrl+shift+opt+cmd+right →  next_window
    ctrl+shift+opt+cmd+up →  previous_tab
Removed shortcuts:
    cmd+enter →  new_window
    ctrl+shift+tab →  previous_tab
    ctrl+tab →  next_tab
    kitty_mod+[ →  previous_window
    kitty_mod+] →  next_window
    kitty_mod+b →  move_window_backward
    kitty_mod+enter →  new_window
    kitty_mod+f →  move_window_forward
    kitty_mod+h →  show_scrollback
    kitty_mod+l →  next_layout
    kitty_mod+left →  previous_tab
    kitty_mod+right →  next_tab
    kitty_mod+w →  close_window
    kitty_mod+x →  scroll_to_prompt 1
    kitty_mod+z →  scroll_to_prompt -1
    shift+cmd+[ →  previous_tab
    shift+cmd+] →  next_tab
    shift+cmd+d →  close_window
    shift+cmd+w →  close_os_window
Changed shortcuts:
    cmd+down →  scroll_to_prompt 1
    cmd+h →  show_scrollback
    cmd+up →  scroll_to_prompt -1
    cmd+w →  close_window_with_confirmation
Colors:
    background                 #000010   
    cursor                     #61afef   

Important environment variables seen by the kitty process:
    PATH                                /Applications/kitty.app/Contents/MacOS:/usr/bin:/bin:/usr/sbin:/sbin
    LANG                                en_GB.UTF-8
    SHELL                               /bin/zsh
    USER                                nagybotond

With a little guidance I'd be happy to investigate what might be causing this issue.

kovidgoyal commented 1 year ago

I dont see what kitty can do about this, it has no control over mission control. The animations are not drawn by it. If someone who is familiar with mission control internals has any suggestions, I am all ears. Note that in current master kitty has been changed to draw itself immediately on window resize events rather than at the next device link frame. I dont know if this will help or make things worse, you can try the nightly build and check.

westernwontons commented 1 year ago

For those who might bump into this issue on MacOS, go to System Settings -> Accessibility -> Display -> Reduce Transparency and enable it. Removed the issue completely.

Source: https://github.com/alacritty/alacritty/issues/4474 issue over at Alacritty