kovidgoyal/kitty

GNOME 3 Wayland title bar is completely missing

sesse opened this issue · 1 comments

sesse commented

I'm running GNOME 3 with Wayland. After a recent change, kitty no longer draws a title bar; it is there, and you can see the outlines of it, but is completely transparent with no text or anything. This is what it looks like:

Skjermbilde fra 2024-05-12 15-35-26

This started happening after this commit:

commit 235b8dc2e44e2c0f66f3bbedaff752704f2138ef
Author: Kovid Goyal <kovid@kovidgoyal.net>
Date:   Sat Apr 6 10:59:28 2024 +0530

    Assume all capabilities on compositors that dont support reporting of capabilities

 glfw/wl_init.c     | 5 +++--
 glfw/wl_platform.h | 1 +
 glfw/wl_window.c   | 8 +++++---
 3 files changed, 9 insertions(+), 5 deletions(-)

Environment details

kitty 0.34.1 created by Kovid Goyal
Linux kos 6.6.9-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.6.9-1 (2024-01-10) x86_64
Debian GNU/Linux trixie/sid kos /dev/tty

Running under: Wayland (GNOME Shell 44.9) missing: preferred_scale
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/sesse/.config/kitty/kitty.conf

Config options different from defaults:
bold_font               Noto Sans Mono Bold
cursor_blink_interval   0.0
enable_audio_bell       False
font_family             Noto Mono
font_size               12.0
initial_window_height   (24, 'cells')
initial_window_width    (82, 'cells')
input_delay             0
placement_strategy      top-left
remember_window_size    False
repaint_delay           2
shell_integration       frozenset({'no-cursor'})
sync_to_monitor         False
touch_scroll_multiplier 5.0
wayland_enable_ime      False
Added shortcuts:
        shift+page_down →  scroll_page_down
        shift+page_up →  scroll_page_up
Colors:
        active_border_color     #c0bfbc   
        active_tab_background   #b0afac   
        active_tab_foreground   #504e55   
        background              #fcfcfc   
        bell_border_color       #ed333b   
        color0                  #fcfcfc   
        color1                  #ed333b   
        color10                 #8ff0a4   
        color11                 #ffa348   
        color12                 #99c1f1   
        color13                 #dc8add   
        color14                 #93ddc2   
        color15                 #f6f5f4   
        color2                  #57e389   
        color3                  #ff7800   
        color4                  #62a0ea   
        color5                  #9141ac   
        color6                  #5bc8af   
        color7                  #deddda   
        color8                  #9a9996   
        color9                  #f66151   
        cursor                  #504e55   
        cursor_text_color       #fcfcfc   
        foreground              #504e55   
        inactive_border_color   #f6f5f4   
        inactive_tab_background #deddda   
        inactive_tab_foreground #5e5c64   
        selection_background    #deddda   
        selection_foreground    #5e5c64   
        url_color               #1a5fb4   

Important environment variables seen by the kitty process:
        PATH                                /usr/local/sbin:/usr/local/bin:/usr/s>
        LANG                                nb_NO.UTF-8
        SHELL                               /bin/zsh
        DISPLAY                             :0
        WAYLAND_DISPLAY                     wayland-0
        USER                                sesse
        XDG_RUNTIME_DIR                     /run/user/1000
        XDG_CURRENT_DESKTOP                 GNOME
        XDG_MENU_PREFIX                     gnome-
        XDG_SESSION_CLASS                   user
        XDG_SESSION_DESKTOP                 gnome
        XDG_SESSION_TYPE                    wayland

Additional context
This happens even with kitty --config NONE .

Works fine with up-to-date GNOME aka version 46.1. I suggest you stick with older kitty till you are ready to update GNOME as well, as GNOME's wayland support is extremely buggy, and I dont have the time/[atience to try and workaround even more of their bugs than I absolutely have to. I dont see anything in that commit that could cause the issue you are describing. All it does is set capabilities to ON on compositors that dont report capabilities, which means all buttons are drawn in the titlebar. I tried the following patch against master which simulates being on a compositor that doesnt support capabilities, and it still drew fine under gnome 46

diff --git a/glfw/wl_window.c b/glfw/wl_window.c
index ec9ce7608b..ecb9871501 100644
--- a/glfw/wl_window.c
+++ b/glfw/wl_window.c
@@ -724,6 +724,7 @@ static void xdgToplevelHandleClose(void* data,
 static void
 xdg_toplevel_wm_capabilities(void *data, struct xdg_toplevel *xdg_toplevel UNUSED, struct wl_array *caps) {
     _GLFWwindow *window = data;
+    if (1) return;
 #define c (window->wl.wm_capabilities)
     memset(&c, 0, sizeof(c));
 
@@ -1107,6 +1108,7 @@ create_window_desktop_surface(_GLFWwindow* window)
     if (_glfw.wl.xdg_wm_base_version < XDG_TOPLEVEL_WM_CAPABILITIES_SINCE_VERSION)
         memset(&window->wl.wm_capabilities, 0xff, sizeof(window->wl.wm_capabilities));
 #endif
+    memset(&window->wl.wm_capabilities, 0xff, sizeof(window->wl.wm_capabilities));
     xdg_toplevel_add_listener(window->wl.xdg.toplevel, &xdgToplevelListener, window);
     if (_glfw.wl.decorationManager) {
         window->wl.xdg.decoration = zxdg_decoration_manager_v1_get_toplevel_decoration(