kovidgoyal / kitty

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

GIF animation randomly start/stops on wayland #6126

Closed Nogesma closed 1 year ago

Nogesma commented 1 year ago

Describe the bug When displaying any gifs either using icat directly or using the graphics protocol, the gifs do not animate. When I change the window focus (ie. click out of kitty then click back in) sometimes the gifs start to animate for a few frames, then stop playing. I cannot reproduce this on macOS.

Example gif that doesn't work

To Reproduce Steps to reproduce the behavior:

  1. Open kitty
  2. Run kitty +kitten icat test.gif
  3. GIF doensn't animate
  4. Change window focus
  5. GIF sometimes animate for a few frames

Recording Video of the issue

Environment details

kitty 0.27.1 () created by Kovid Goyal
Linux archlinux 6.2.7-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Sat, 18 Mar 2023 01:06:38 +0000 x86_64
Arch Linux 6.2.7-zen1-1-zen (/dev/tty)

DISTRIB_ID="Arch"
DISTRIB_RELEASE="rolling"
DISTRIB_DESCRIPTION="Arch Linux"
Running under: Wayland
Frozen: False
Paths:
  kitty: /usr/bin/kitty
  base dir: /usr/lib/kitty
  extensions dir: /usr/lib/kitty/kitty
  system shell: /bin/zsh
Loaded config files:
  /home/segransm/.config/kitty/kitty.conf

Config options different from defaults:
bold_font               Jetbrains Mono Bold
bold_italic_font        Jetbrains Mono Bold Italic
clipboard_max_size      64.0
confirm_os_window_close 0
disable_ligatures       1
enable_audio_bell       False
enabled_layouts         ['grid']
font_family             Jetbrains Mono
font_size               12.0
input_delay             1
italic_font             Jetbrains Mono Italic
modify_font:
    baseline 0
    cell_height 0
    cell_width 0
mouse_hide_wait         -1.0
repaint_delay           5
resize_draw_strategy    2
tab_title_template      {title}
update_check_interval   24.0
url_prefixes            ('http', 'https', 'file', 'ftp', 'gemini', 'irc', 'gopher', 'mailto', 'news', 'git')
url_style               1
Added shortcuts:
    alt+super+, →  debug_config
    alt+super+page_down →  scroll_line_down
    alt+super+page_up →  scroll_line_up
    alt+super+r →  clear_terminal reset active
    ctrl+super+, →  load_config_file
    ctrl+super+space →  kitten unicode_input
    ctrl+t →  signal_child SIGUSR1
    shift+super+- →  change_font_size all -2.0
    shift+super+= →  change_font_size all +2.0
    shift+super+[ →  previous_tab
    shift+super+] →  next_tab
    shift+super+d →  close_window
    shift+super+i →  set_tab_title
    shift+super+w →  close_os_window
    super++ →  change_font_size all +2.0
    super+, →  edit_config_file
    super+- →  change_font_size all -2.0
    super+0 →  change_font_size all 0
    super+1 →  first_window
    super+2 →  second_window
    super+3 →  third_window
    super+4 →  fourth_window
    super+5 →  fifth_window
    super+6 →  sixth_window
    super+7 →  seventh_window
    super+8 →  eighth_window
    super+9 →  ninth_window
    super+= →  change_font_size all +2.0
    super+down →  scroll_line_down
    super+end →  scroll_end
    super+enter →  new_window
    super+home →  scroll_home
    super+n →  new_os_window
    super+page_down →  scroll_page_down
    super+page_up →  scroll_page_up
    super+r →  start_resizing_window
    super+t →  new_tab
    super+up →  scroll_line_up
    super+w →  close_tab
Changed shortcuts:
    kitty_mod+enter →  new_os_window_with_cwd
Colors:
    background              #2e3440   
    color0                  #3b4252   
    color1                  #bf616a   
    color10                 #a3be8c   
    color11                 #ebcb8b   
    color12                 #81a1c1   
    color13                 #b48ead   
    color14                 #8fbcbb   
    color15                 #eceff4   
    color2                  #a3be8c   
    color3                  #ebcb8b   
    color4                  #81a1c1   
    color5                  #b48ead   
    color6                  #88c0d0   
    color7                  #e5e9f0   
    color8                  #4c566a   
    color9                  #bf616a   
    cursor                  #81a1c1   
    foreground              #d8dee9   

Important environment variables seen by the kitty process:
    PATH                                /usr/local/sbin:/usr/local/bin:/usr/bin:/home/segransm/.dotnet/tools:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
    LANG                                en_US.UTF-8
    SHELL                               /bin/zsh
    DISPLAY                             :0
    WAYLAND_DISPLAY                     wayland-1
    USER                                segransm
    XCURSOR_SIZE                        24
    XDG_SEAT                            seat0
    XDG_SESSION_TYPE                    wayland
    XDG_CURRENT_DESKTOP                 sway
    XDG_SESSION_CLASS                   user
    XDG_VTNR                            1
    XDG_SESSION_ID                      1
    XDG_RUNTIME_DIR                     /run/user/1000

Additional context I can reproduce with kitty --config NONE

kovidgoyal commented 1 year ago

This will be a wayland specific issue, easily confirmed by add linux_display_backend x11 to kitty.conf

I will look into it the next time I am dealing with Wayland crap. Most likely kitty will have to explicitly send render requests to the compositor on wayland. Sigh.