Dragging tabs from other applications kills foot instance #1092

Closed
opened 5 months ago by jnns · 14 comments
jnns commented 5 months ago

I run a two monitor setup on Fedora 36 with Gnome-Shell on Wayland. One monitor has Firefox in full screen mode and the other runs foot. I tried to spawn a new Firefox window on the monitor with the foot window by dragging a tab out of Firefox' tab bar.

The foot window gets killed and disappears as soon as the drag operation ends when I release the mouse cursor. No new Firefox window is created. The tab I dragged out remains in the main Firefox window.

The same thing happens when I drag a GIMP tab onto foot. It doesn't happen when I run Gnome Terminal instead of foot.

This is the output when foot crashes:

warn: ime.c:118: seat0: text-input::done() received on seat that isn't focusing a terminal window
error marshalling arguments for receive (signature sh): null value passed for arg 0
Error marshalling request: Invalid argument
 err: wayland.c:1169: failed to dispatch pending Wayland events: Invalid argument
 err: wayland.c:1690: failed to roundtrip Wayland display: Invalid argument
 err: wayland.c:1690: failed to roundtrip Wayland display: Invalid argument
 err: wayland.c:1690: failed to roundtrip Wayland display: Invalid argument
warn: terminal.c:1769: slave exited with signal 15 (Terminated)
 err: wayland.c:1655: failed to flush wayland socket: Invalid argument
warn: fdm.c:112: FD list not empty
info: main.c:680: goodbye

Please let me know if I can add more information that helps you identify the cause of this.

I run a two monitor setup on Fedora 36 with Gnome-Shell on Wayland. One monitor has Firefox in full screen mode and the other runs foot. I tried to spawn a new Firefox window on the monitor with the foot window by dragging a tab out of Firefox' tab bar. The foot window gets killed and disappears as soon as the drag operation ends when I release the mouse cursor. No new Firefox window is created. The tab I dragged out remains in the main Firefox window. The same thing happens when I drag a GIMP tab onto foot. It doesn't happen when I run Gnome Terminal instead of foot. This is the output when foot crashes: ``` warn: ime.c:118: seat0: text-input::done() received on seat that isn't focusing a terminal window error marshalling arguments for receive (signature sh): null value passed for arg 0 Error marshalling request: Invalid argument err: wayland.c:1169: failed to dispatch pending Wayland events: Invalid argument err: wayland.c:1690: failed to roundtrip Wayland display: Invalid argument err: wayland.c:1690: failed to roundtrip Wayland display: Invalid argument err: wayland.c:1690: failed to roundtrip Wayland display: Invalid argument warn: terminal.c:1769: slave exited with signal 15 (Terminated) err: wayland.c:1655: failed to flush wayland socket: Invalid argument warn: fdm.c:112: FD list not empty info: main.c:680: goodbye ``` Please let me know if I can add more information that helps you identify the cause of this.
Owner

I can't reproduce (on GNOME, with Firefox, and foot from git head).

Can you please do a debug build of foot and get a backtrace from the crash?

That is, run the debug build of foot in gdb (gdb --args ./foot, then run on the gdb prompt), reproduce the crash, and then run bt full on the gdb prompt.

Note: you don't have to install the debug build, just run foot from the build directory.

I can't reproduce (on GNOME, with Firefox, and foot from git head). Can you please do a debug build of foot and get a backtrace from the crash? That is, run the debug build of foot in gdb (`gdb --args ./foot`, then `run` on the gdb prompt), reproduce the crash, and then run `bt full` on the gdb prompt. Note: you don't have to install the debug build, just run foot from the build directory.
Poster

Here's the output you requested running foot master:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[Detaching after fork from child process 269986]
[New Thread 0x7fffe9f22640 (LWP 269987)]
[New Thread 0x7fffe1721640 (LWP 269988)]
[New Thread 0x7fffe9721640 (LWP 269989)]
[New Thread 0x7fffe8f20640 (LWP 269990)]
[Thread 0x7fffe9721640 (LWP 269989) exited]
[Thread 0x7fffe9f22640 (LWP 269987) exited]
[Thread 0x7fffe1721640 (LWP 269988) exited]
[Thread 0x7fffe8f20640 (LWP 269990) exited]
[New Thread 0x7fffe8f20640 (LWP 269991)]
[New Thread 0x7fffe9721640 (LWP 269993)]
[New Thread 0x7fffe1721640 (LWP 269994)]
[New Thread 0x7fffe9f22640 (LWP 269995)]
[New Thread 0x7fffe3fff640 (LWP 269996)]
[New Thread 0x7fffe37fe640 (LWP 269998)]
[New Thread 0x7fffe2ffd640 (LWP 269999)]
[New Thread 0x7fffe27fc640 (LWP 270000)]
[New Thread 0x7fffe1ffb640 (LWP 270046)]
[New Thread 0x7fffe0f20640 (LWP 270047)]
[New Thread 0x7fff9bfff640 (LWP 270048)]
[New Thread 0x7fff9b7fe640 (LWP 270049)]
[Thread 0x7fffe0f20640 (LWP 270047) exited]
[Thread 0x7fff9bfff640 (LWP 270048) exited]
[Thread 0x7fffe1ffb640 (LWP 270046) exited]
[Thread 0x7fff9b7fe640 (LWP 270049) exited]
[Thread 0x7fffe2ffd640 (LWP 269999) exited]
[Thread 0x7fffe27fc640 (LWP 270000) exited]
[Thread 0x7fffe37fe640 (LWP 269998) exited]
[Thread 0x7fffe3fff640 (LWP 269996) exited]
[Thread 0x7fffe9f22640 (LWP 269995) exited]
[Thread 0x7fffe1721640 (LWP 269994) exited]
[Thread 0x7fffe9721640 (LWP 269993) exited]
[Thread 0x7fffe8f20640 (LWP 269991) exited]

Thread 1 "foot" received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
44	      return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
        tid = <optimized out>
        ret = 0
        pd = <optimized out>
        old_mask = {__val = {140737488347416, 140737488339424, 140737488347416, 140737488339424, 0, 4664787, 140737488343983, 1914252544, 4906204, 4818178, 4906195, 
            4294967422, 2, 9223372036854775822, 0, 0}}
        ret = <optimized out>
#1  0x00007ffff7a3eca3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
No locals.
#2  0x00007ffff79ee9c6 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
        ret = <optimized out>
#3  0x00007ffff79d87f4 in __GI_abort () at abort.c:79
        save_stage = 1
        act = {__sigaction_handler = {sa_handler = 0x32403237ffffffff, sa_sigaction = 0x32403237ffffffff}, sa_mask = {__val = {7147049208476103471, 3996999881840747631, 
              4819344, 0, 4818178, 4818184, 8589934704, 7886488382152074095, 3620949314227025708, 7363221990589887279, 3996999881841275503, 3416934072636878642, 
              3618409639653240169, 8391102423593269112, 140737349584544, 140737349567968}}, sa_flags = -140340036, sa_restorer = 0x7fffffffd470}
        sigs = {__val = {32, 206158430248, 140737488339808, 140737488339616, 140737488339792, 4665578, 4906204, 4818178, 4906195, 4294967422, 7521907940915115123, 
            206158430256, 140737488339816, 140737488339616, 8391102423446860343, 7306086967289799535}}
#4  0x0000000000475da6 in bug (file=0x498502 "fdm.c", line=126, func=0x498990 <__func__.7> "fdm_destroy", fmt=0x49853f "assertion failed: '%s'") at ../debug.c:46
        buf = "assertion failed: 'tll_length(fdm->fds) == 0'\000\062x72@2/stock/object,72x72/stock/table,72x72@2/stock/table,72x72/stock/text,72x72@2/stock/text,96x96/actions,96x96@2/actions,96x96/animations,96x96@2/anima"...
        ap = {{gp_offset = 40, fp_offset = 48, overflow_arg_area = 0x7fffffffd480, reg_save_area = 0x7fffffffd3c0}}
        n = 45
        msg = 0x7fffffffc3b0 "assertion failed: 'tll_length(fdm->fds) == 0'"
#5  0x000000000041aa3b in fdm_destroy (fdm=0x51b5c0) at ../fdm.c:126
        __func__ = "fdm_destroy"
#6  0x0000000000427a1f in main (argc=0, argv=0x7fffffffe120) at ../main.c:673
        foot_exit_failure = -26
        ret = -26
        token = 0x0
        prog_name = 0x7fffffffe42a "foot"
        longopts = {{name = 0x4a201c "config", has_arg = 1, flag = 0x0, val = 99}, {name = 0x4a2023 "check-config", has_arg = 0, flag = 0x0, val = 67}, {
            name = 0x4a2030 "override", has_arg = 1, flag = 0x0, val = 111}, {name = 0x4a2039 "term", has_arg = 1, flag = 0x0, val = 116}, {name = 0x4a203e "title", 
            has_arg = 1, flag = 0x0, val = 84}, {name = 0x4a2044 "app-id", has_arg = 1, flag = 0x0, val = 97}, {name = 0x4a204b "login-shell", has_arg = 0, flag = 0x0, 
            val = 76}, {name = 0x4a2057 "working-directory", has_arg = 1, flag = 0x0, val = 68}, {name = 0x4a2069 "font", has_arg = 1, flag = 0x0, val = 102}, {
            name = 0x4a206e "window-size-pixels", has_arg = 1, flag = 0x0, val = 119}, {name = 0x4a2081 "window-size-chars", has_arg = 1, flag = 0x0, val = 87}, {
            name = 0x4a2093 "server", has_arg = 2, flag = 0x0, val = 115}, {name = 0x4a209a "hold", has_arg = 0, flag = 0x0, val = 72}, {name = 0x4a209f "maximized", 
            has_arg = 0, flag = 0x0, val = 109}, {name = 0x4a20a9 "fullscreen", has_arg = 0, flag = 0x0, val = 70}, {name = 0x4a20b4 "presentation-timings", has_arg = 0, 
            flag = 0x0, val = 80}, {name = 0x4a20c9 "print-pid", has_arg = 1, flag = 0x0, val = 112}, {name = 0x4a20d3 "log-level", has_arg = 1, flag = 0x0, val = 100}, {
            name = 0x4a20dd "log-colorize", has_arg = 2, flag = 0x0, val = 108}, {name = 0x4a20ea "log-no-syslog", has_arg = 0, flag = 0x0, val = 83}, {
            name = 0x4a20f8 "version", has_arg = 0, flag = 0x0, val = 118}, {name = 0x4a2100 "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x0, has_arg = 0, flag = 0x0, val = 0}}
        check_config = false
        conf_path = 0x0
        conf_term = 0x0
        conf_title = 0x0
        conf_app_id = 0x0
        custom_cwd = 0x0
        login_shell = false
        conf_fonts = {head = 0x0, tail = 0x0, length = 0}
        conf_size_type = CONF_SIZE_PX
        conf_width = -1
        conf_height = -1
        as_server = false
        conf_server_socket_path = 0x0
        presentation_timings = false
        hold = false
        maximized = false
        fullscreen = false
        unlink_pid_file = false
        pid_file = 0x0
        log_level = LOG_CLASS_INFO
        log_colorize = LOG_COLORIZE_AUTO
        log_syslog = true
        user_notifications = {head = 0x0, tail = 0x0, length = 0}
        overrides = {head = 0x0, tail = 0x0, length = 0}
        __func__ = "main"
        locale = 0x4cf040 "de_DE.UTF-8"
        bad_locale = false
        conf = {term = 0x4cf2a0 "xterm-256color", shell = 0x4cefb0 "/usr/bin/fish", title = 0x4ceea0 "foot", app_id = 0x4ced60 "foot", word_delimiters = 0x4d06d0 U",│`|:\"'()[]{}<>", login_shell = false, locked_title = false, size = {type = CONF_SIZE_PX, width = 700, height = 500}, pad_x = 2, pad_y = 2, center = false, resize_delay_ms = 100, bold_in_bright = {enabled = false, palette_based = false}, startup_mode = STARTUP_WINDOWED, dpi_aware = DPI_AWARE_AUTO, fonts = {{count = 1, arr = 0x4d0610}, {count = 0, arr = 0x0}, {count = 0, arr = 0x0}, {count = 0, arr = 0x0}}, line_height = {px = -1, pt = 0}, letter_spacing = {px = 0, pt = 0}, horizontal_letter_offset = {px = 0, pt = 0}, vertical_letter_offset = {px = 0, pt = 0}, use_custom_underline_offset = false, underline_offset = {px = 0, pt = 0}, box_drawings_uses_font_glyphs = false, can_shape_grapheme = true, bell = {urgent = false, notify = false, command = {argv = {args = 0x0}}, command_focused = false}, scrollback = {lines = 1000, indicator = {position = SCROLLBACK_INDICATOR_POSITION_RELATIVE, format = SCROLLBACK_INDICATOR_FORMAT_TEXT, text = 0x4d28a0 U""}, multiplier = 3}, url = {label_letters = 0x4d3430 U"sadfjklewcmpgh", launch = {argv = {args = 0x4d1b90}}, osc8_underline = OSC8_UNDERLINE_URL_MODE, protocols = 0x4d3220, uri_characters = 0x4d3480 U"!\"#$%&'()*+,-./0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]_abcdefghijklmnopqrstuvwxyz~", prot_count = 9, max_prot_len = 9}, colors = {fg = 5465965, bg = 16511963, table = {15524812, 13771053, 4755712, 11372800, 29396, 13256856, 40079, 9476501, 14011830, 13375273, 4360960, 10978048, 28110, 12862354, 38794, 3820883, 0, 95, 135, 175, 215, 255, 24320, 24415, 24455, 24495, 24535, 24575, 34560, 34655, 34695, 34735, 34775, 34815, 44800, 44895, 44935, 44975, 45015, 45055, 55040, 55135, 55175, 55215, 55255, 55295, 65280, 65375, 65415, 65455, 65495, 65535, 6225920, 6226015, 6226055, 6226095, 6226135, 6226175, 6250240, 6250335, 6250375, 6250415, 6250455, 6250495, 6260480, 6260575, 6260615, 6260655, 6260695, 6260735, 6270720, 6270815, 6270855, 6270895, 6270935, 6270975, 6280960, 6281055, 6281095, 6281135, 6281175, 6281215, 6291200, 6291295, 6291335, 6291375, 6291415, 6291455, 8847360, 8847455, 8847495, 8847535, 8847575, 8847615, 8871680, 8871775, 8871815, 8871855, 8871895, 8871935, 8881920, 8882015, 8882055, 8882095, 8882135, 8882175, 8892160, 8892255, 8892295, 8892335, 8892375, 8892415, 8902400, 8902495, 8902535, 8902575, 8902615, 8902655, 8912640, 8912735, 8912775, 8912815, 8912855, 8912895, 11468800, 11468895, 11468935, 11468975, 11469015, 11469055, 11493120, 11493215, 11493255, 11493295, 11493335, 11493375, 11503360, 11503455, 11503495, 11503535, 11503575, 11503615, 11513600, 11513695, 11513735, 11513775, 11513815, 11513855, 11523840, 11523935, 11523975, 11524015, 11524055, 11524095, 11534080, 11534175, 11534215, 11534255, 11534295, 11534335, 14090240, 14090335, 14090375, 14090415, 14090455, 14090495, 14114560, 14114655, 14114695, 14114735, 14114775, 14114815, 14124800, 14124895, 14124935, 14124975, 14125015, 14125055, 14135040, 14135135, 14135175, 14135215, 14135255, 14135295, 14145280, 14145375, 14145415, 14145455, 14145495, 14145535, 14155520, 14155615, 14155655, 14155695, 14155735, 14155775, 16711680, 16711775, 16711815, 16711855...}, alpha = 65535, selection_fg = 2147483648, selection_bg = 2147483648, url = 0, dim = {0, 0, 0, 0, 0, 0, 0, 0}, jump_label = {fg = 0, bg = 0}, scrollback_indicator = {fg = 0, bg = 0}, use_custom = {selection = false, jump_label = false, scrollback_indicator = false, url = false, dim = 0 '\000'}}, cursor = {style = CURSOR_BLOCK, blink = false, color = {text = 2163995611, cursor = 2147522442}, beam_thickness = {px = 0, pt = 1.5}, underline_thickness = {px = -1, pt = 0}}, mouse = {hide_when_typing = false, alternate_scroll_mode = true, selection_override_modifiers = {shift = true, alt = false, ctrl = false, super = false}}, bindings = {key = {count = 19, arr = 0x4d1cc0}, mouse = {count = 8, arr = 0x4d12b0}, search = {count = 31, arr = 0x4d3e60}, url = {count = 5, arr = 0x4d1190}}, csd = {preferred = CONF_CSD_PREFER_CLIENT, title_height = 26, border_width = 5, border_width_visible = 0, button_width = 26, hide_when_maximized = false, color = {title_set = false, buttons_set = false, minimize_set = false, maximize_set = false, close_set = false, border_set = false, title = 0, buttons = 0, minimize = 0, maximize = 0, quit = 0, border = 0}, font = {count = 1, arr = 0x4d31d0}}, render_worker_count = 8, server_socket_path = 0x4cf540 "/run/user/1000/foot-wayland-0.sock", presentation_timings = false, hold_at_exit = false, selection_target = SELECTION_TARGET_PRIMARY, notify = {argv = {args = 0x4d1a90}}, notify_focus_inhibit = true, env_vars = {head = 0x0, tail = 0x0, length = 0}, tweak = {fcft_filter = FCFT_SCALING_FILTER_LANCZOS3, overflowing_glyphs = true, grapheme_shaping = false, grapheme_width_method = GRAPHEME_WIDTH_WCSWIDTH, render_timer = RENDER_TIMER_NONE, damage_whole_window = false, delayed_render_lower_ns = 500000, delayed_render_upper_ns = 8333333, max_shm_pool_size = 536870912, box_drawing_base_thickness = 0.0399999991, box_drawing_solid_shades = true, font_monospace_warn = true, sixel = true}, notifications = {head = 0x0, tail = 0x0, length = 0}}
        conf_successful = true
        fdm = 0x51b5c0
        reaper = 0x53c5d0
        key_binding_manager = 0x4e66d0
        wayl = 0x4d5380
        renderer = 0x538fb0
        term = 0x5773c0
        server = 0x0
        shutdown_ctx = {term = 0x7fffffffd778, exit_code = -26}
        cwd = 0x4e60b0 "\206\067N"
        _cwd = 0x0
        aborted = 0
        sig_ign = {__sigaction_handler = {sa_handler = 0x1, sa_sigaction = 0x1}, sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = 0, sa_restorer = 0x0}

Here's the output you requested running foot master: ``` [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". [Detaching after fork from child process 269986] [New Thread 0x7fffe9f22640 (LWP 269987)] [New Thread 0x7fffe1721640 (LWP 269988)] [New Thread 0x7fffe9721640 (LWP 269989)] [New Thread 0x7fffe8f20640 (LWP 269990)] [Thread 0x7fffe9721640 (LWP 269989) exited] [Thread 0x7fffe9f22640 (LWP 269987) exited] [Thread 0x7fffe1721640 (LWP 269988) exited] [Thread 0x7fffe8f20640 (LWP 269990) exited] [New Thread 0x7fffe8f20640 (LWP 269991)] [New Thread 0x7fffe9721640 (LWP 269993)] [New Thread 0x7fffe1721640 (LWP 269994)] [New Thread 0x7fffe9f22640 (LWP 269995)] [New Thread 0x7fffe3fff640 (LWP 269996)] [New Thread 0x7fffe37fe640 (LWP 269998)] [New Thread 0x7fffe2ffd640 (LWP 269999)] [New Thread 0x7fffe27fc640 (LWP 270000)] [New Thread 0x7fffe1ffb640 (LWP 270046)] [New Thread 0x7fffe0f20640 (LWP 270047)] [New Thread 0x7fff9bfff640 (LWP 270048)] [New Thread 0x7fff9b7fe640 (LWP 270049)] [Thread 0x7fffe0f20640 (LWP 270047) exited] [Thread 0x7fff9bfff640 (LWP 270048) exited] [Thread 0x7fffe1ffb640 (LWP 270046) exited] [Thread 0x7fff9b7fe640 (LWP 270049) exited] [Thread 0x7fffe2ffd640 (LWP 269999) exited] [Thread 0x7fffe27fc640 (LWP 270000) exited] [Thread 0x7fffe37fe640 (LWP 269998) exited] [Thread 0x7fffe3fff640 (LWP 269996) exited] [Thread 0x7fffe9f22640 (LWP 269995) exited] [Thread 0x7fffe1721640 (LWP 269994) exited] [Thread 0x7fffe9721640 (LWP 269993) exited] [Thread 0x7fffe8f20640 (LWP 269991) exited] Thread 1 "foot" received signal SIGABRT, Aborted. __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 44 return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0; #0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 tid = <optimized out> ret = 0 pd = <optimized out> old_mask = {__val = {140737488347416, 140737488339424, 140737488347416, 140737488339424, 0, 4664787, 140737488343983, 1914252544, 4906204, 4818178, 4906195, 4294967422, 2, 9223372036854775822, 0, 0}} ret = <optimized out> #1 0x00007ffff7a3eca3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78 No locals. #2 0x00007ffff79ee9c6 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 ret = <optimized out> #3 0x00007ffff79d87f4 in __GI_abort () at abort.c:79 save_stage = 1 act = {__sigaction_handler = {sa_handler = 0x32403237ffffffff, sa_sigaction = 0x32403237ffffffff}, sa_mask = {__val = {7147049208476103471, 3996999881840747631, 4819344, 0, 4818178, 4818184, 8589934704, 7886488382152074095, 3620949314227025708, 7363221990589887279, 3996999881841275503, 3416934072636878642, 3618409639653240169, 8391102423593269112, 140737349584544, 140737349567968}}, sa_flags = -140340036, sa_restorer = 0x7fffffffd470} sigs = {__val = {32, 206158430248, 140737488339808, 140737488339616, 140737488339792, 4665578, 4906204, 4818178, 4906195, 4294967422, 7521907940915115123, 206158430256, 140737488339816, 140737488339616, 8391102423446860343, 7306086967289799535}} #4 0x0000000000475da6 in bug (file=0x498502 "fdm.c", line=126, func=0x498990 <__func__.7> "fdm_destroy", fmt=0x49853f "assertion failed: '%s'") at ../debug.c:46 buf = "assertion failed: 'tll_length(fdm->fds) == 0'\000\062x72@2/stock/object,72x72/stock/table,72x72@2/stock/table,72x72/stock/text,72x72@2/stock/text,96x96/actions,96x96@2/actions,96x96/animations,96x96@2/anima"... ap = {{gp_offset = 40, fp_offset = 48, overflow_arg_area = 0x7fffffffd480, reg_save_area = 0x7fffffffd3c0}} n = 45 msg = 0x7fffffffc3b0 "assertion failed: 'tll_length(fdm->fds) == 0'" #5 0x000000000041aa3b in fdm_destroy (fdm=0x51b5c0) at ../fdm.c:126 __func__ = "fdm_destroy" #6 0x0000000000427a1f in main (argc=0, argv=0x7fffffffe120) at ../main.c:673 foot_exit_failure = -26 ret = -26 token = 0x0 prog_name = 0x7fffffffe42a "foot" longopts = {{name = 0x4a201c "config", has_arg = 1, flag = 0x0, val = 99}, {name = 0x4a2023 "check-config", has_arg = 0, flag = 0x0, val = 67}, { name = 0x4a2030 "override", has_arg = 1, flag = 0x0, val = 111}, {name = 0x4a2039 "term", has_arg = 1, flag = 0x0, val = 116}, {name = 0x4a203e "title", has_arg = 1, flag = 0x0, val = 84}, {name = 0x4a2044 "app-id", has_arg = 1, flag = 0x0, val = 97}, {name = 0x4a204b "login-shell", has_arg = 0, flag = 0x0, val = 76}, {name = 0x4a2057 "working-directory", has_arg = 1, flag = 0x0, val = 68}, {name = 0x4a2069 "font", has_arg = 1, flag = 0x0, val = 102}, { name = 0x4a206e "window-size-pixels", has_arg = 1, flag = 0x0, val = 119}, {name = 0x4a2081 "window-size-chars", has_arg = 1, flag = 0x0, val = 87}, { name = 0x4a2093 "server", has_arg = 2, flag = 0x0, val = 115}, {name = 0x4a209a "hold", has_arg = 0, flag = 0x0, val = 72}, {name = 0x4a209f "maximized", has_arg = 0, flag = 0x0, val = 109}, {name = 0x4a20a9 "fullscreen", has_arg = 0, flag = 0x0, val = 70}, {name = 0x4a20b4 "presentation-timings", has_arg = 0, flag = 0x0, val = 80}, {name = 0x4a20c9 "print-pid", has_arg = 1, flag = 0x0, val = 112}, {name = 0x4a20d3 "log-level", has_arg = 1, flag = 0x0, val = 100}, { name = 0x4a20dd "log-colorize", has_arg = 2, flag = 0x0, val = 108}, {name = 0x4a20ea "log-no-syslog", has_arg = 0, flag = 0x0, val = 83}, { name = 0x4a20f8 "version", has_arg = 0, flag = 0x0, val = 118}, {name = 0x4a2100 "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x0, has_arg = 0, flag = 0x0, val = 0}} check_config = false conf_path = 0x0 conf_term = 0x0 conf_title = 0x0 conf_app_id = 0x0 custom_cwd = 0x0 login_shell = false conf_fonts = {head = 0x0, tail = 0x0, length = 0} conf_size_type = CONF_SIZE_PX conf_width = -1 conf_height = -1 as_server = false conf_server_socket_path = 0x0 presentation_timings = false hold = false maximized = false fullscreen = false unlink_pid_file = false pid_file = 0x0 log_level = LOG_CLASS_INFO log_colorize = LOG_COLORIZE_AUTO log_syslog = true user_notifications = {head = 0x0, tail = 0x0, length = 0} overrides = {head = 0x0, tail = 0x0, length = 0} __func__ = "main" locale = 0x4cf040 "de_DE.UTF-8" bad_locale = false conf = {term = 0x4cf2a0 "xterm-256color", shell = 0x4cefb0 "/usr/bin/fish", title = 0x4ceea0 "foot", app_id = 0x4ced60 "foot", word_delimiters = 0x4d06d0 U",│`|:\"'()[]{}<>", login_shell = false, locked_title = false, size = {type = CONF_SIZE_PX, width = 700, height = 500}, pad_x = 2, pad_y = 2, center = false, resize_delay_ms = 100, bold_in_bright = {enabled = false, palette_based = false}, startup_mode = STARTUP_WINDOWED, dpi_aware = DPI_AWARE_AUTO, fonts = {{count = 1, arr = 0x4d0610}, {count = 0, arr = 0x0}, {count = 0, arr = 0x0}, {count = 0, arr = 0x0}}, line_height = {px = -1, pt = 0}, letter_spacing = {px = 0, pt = 0}, horizontal_letter_offset = {px = 0, pt = 0}, vertical_letter_offset = {px = 0, pt = 0}, use_custom_underline_offset = false, underline_offset = {px = 0, pt = 0}, box_drawings_uses_font_glyphs = false, can_shape_grapheme = true, bell = {urgent = false, notify = false, command = {argv = {args = 0x0}}, command_focused = false}, scrollback = {lines = 1000, indicator = {position = SCROLLBACK_INDICATOR_POSITION_RELATIVE, format = SCROLLBACK_INDICATOR_FORMAT_TEXT, text = 0x4d28a0 U""}, multiplier = 3}, url = {label_letters = 0x4d3430 U"sadfjklewcmpgh", launch = {argv = {args = 0x4d1b90}}, osc8_underline = OSC8_UNDERLINE_URL_MODE, protocols = 0x4d3220, uri_characters = 0x4d3480 U"!\"#$%&'()*+,-./0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]_abcdefghijklmnopqrstuvwxyz~", prot_count = 9, max_prot_len = 9}, colors = {fg = 5465965, bg = 16511963, table = {15524812, 13771053, 4755712, 11372800, 29396, 13256856, 40079, 9476501, 14011830, 13375273, 4360960, 10978048, 28110, 12862354, 38794, 3820883, 0, 95, 135, 175, 215, 255, 24320, 24415, 24455, 24495, 24535, 24575, 34560, 34655, 34695, 34735, 34775, 34815, 44800, 44895, 44935, 44975, 45015, 45055, 55040, 55135, 55175, 55215, 55255, 55295, 65280, 65375, 65415, 65455, 65495, 65535, 6225920, 6226015, 6226055, 6226095, 6226135, 6226175, 6250240, 6250335, 6250375, 6250415, 6250455, 6250495, 6260480, 6260575, 6260615, 6260655, 6260695, 6260735, 6270720, 6270815, 6270855, 6270895, 6270935, 6270975, 6280960, 6281055, 6281095, 6281135, 6281175, 6281215, 6291200, 6291295, 6291335, 6291375, 6291415, 6291455, 8847360, 8847455, 8847495, 8847535, 8847575, 8847615, 8871680, 8871775, 8871815, 8871855, 8871895, 8871935, 8881920, 8882015, 8882055, 8882095, 8882135, 8882175, 8892160, 8892255, 8892295, 8892335, 8892375, 8892415, 8902400, 8902495, 8902535, 8902575, 8902615, 8902655, 8912640, 8912735, 8912775, 8912815, 8912855, 8912895, 11468800, 11468895, 11468935, 11468975, 11469015, 11469055, 11493120, 11493215, 11493255, 11493295, 11493335, 11493375, 11503360, 11503455, 11503495, 11503535, 11503575, 11503615, 11513600, 11513695, 11513735, 11513775, 11513815, 11513855, 11523840, 11523935, 11523975, 11524015, 11524055, 11524095, 11534080, 11534175, 11534215, 11534255, 11534295, 11534335, 14090240, 14090335, 14090375, 14090415, 14090455, 14090495, 14114560, 14114655, 14114695, 14114735, 14114775, 14114815, 14124800, 14124895, 14124935, 14124975, 14125015, 14125055, 14135040, 14135135, 14135175, 14135215, 14135255, 14135295, 14145280, 14145375, 14145415, 14145455, 14145495, 14145535, 14155520, 14155615, 14155655, 14155695, 14155735, 14155775, 16711680, 16711775, 16711815, 16711855...}, alpha = 65535, selection_fg = 2147483648, selection_bg = 2147483648, url = 0, dim = {0, 0, 0, 0, 0, 0, 0, 0}, jump_label = {fg = 0, bg = 0}, scrollback_indicator = {fg = 0, bg = 0}, use_custom = {selection = false, jump_label = false, scrollback_indicator = false, url = false, dim = 0 '\000'}}, cursor = {style = CURSOR_BLOCK, blink = false, color = {text = 2163995611, cursor = 2147522442}, beam_thickness = {px = 0, pt = 1.5}, underline_thickness = {px = -1, pt = 0}}, mouse = {hide_when_typing = false, alternate_scroll_mode = true, selection_override_modifiers = {shift = true, alt = false, ctrl = false, super = false}}, bindings = {key = {count = 19, arr = 0x4d1cc0}, mouse = {count = 8, arr = 0x4d12b0}, search = {count = 31, arr = 0x4d3e60}, url = {count = 5, arr = 0x4d1190}}, csd = {preferred = CONF_CSD_PREFER_CLIENT, title_height = 26, border_width = 5, border_width_visible = 0, button_width = 26, hide_when_maximized = false, color = {title_set = false, buttons_set = false, minimize_set = false, maximize_set = false, close_set = false, border_set = false, title = 0, buttons = 0, minimize = 0, maximize = 0, quit = 0, border = 0}, font = {count = 1, arr = 0x4d31d0}}, render_worker_count = 8, server_socket_path = 0x4cf540 "/run/user/1000/foot-wayland-0.sock", presentation_timings = false, hold_at_exit = false, selection_target = SELECTION_TARGET_PRIMARY, notify = {argv = {args = 0x4d1a90}}, notify_focus_inhibit = true, env_vars = {head = 0x0, tail = 0x0, length = 0}, tweak = {fcft_filter = FCFT_SCALING_FILTER_LANCZOS3, overflowing_glyphs = true, grapheme_shaping = false, grapheme_width_method = GRAPHEME_WIDTH_WCSWIDTH, render_timer = RENDER_TIMER_NONE, damage_whole_window = false, delayed_render_lower_ns = 500000, delayed_render_upper_ns = 8333333, max_shm_pool_size = 536870912, box_drawing_base_thickness = 0.0399999991, box_drawing_solid_shades = true, font_monospace_warn = true, sixel = true}, notifications = {head = 0x0, tail = 0x0, length = 0}} conf_successful = true fdm = 0x51b5c0 reaper = 0x53c5d0 key_binding_manager = 0x4e66d0 wayl = 0x4d5380 renderer = 0x538fb0 term = 0x5773c0 server = 0x0 shutdown_ctx = {term = 0x7fffffffd778, exit_code = -26} cwd = 0x4e60b0 "\206\067N" _cwd = 0x0 aborted = 0 sig_ign = {__sigaction_handler = {sa_handler = 0x1, sa_sigaction = 0x1}, sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = 0, sa_restorer = 0x0} ```
Owner

From what I can tell, the issue is not actually in foot, but in libwayland. The failure in libwayland forces foot to exit.

It might be an issue with how foot is calling one of the Wayland functions (but unlikely, since I cannot reproduce the issue).

Running foot with

WAYLAND_DEBUG=1 foot

might give further insights (no need to run the debug build in this case).

From what I can tell, the issue is not actually in foot, but in libwayland. The failure in libwayland forces foot to exit. It _might_ be an issue with how foot is calling one of the Wayland functions (but unlikely, since I cannot reproduce the issue). Running foot with ```sh WAYLAND_DEBUG=1 foot ``` might give further insights (no need to run the debug build in this case).
Poster

This is the output with WAYLAND_DEBUG=1. Do you think I should file a bug with libwayland instead?

...
[3956181.401]  -> xdg_wm_base@14.pong(27292117)
[3956184.633] wl_data_device@16.motion(27292117, 351.59375000, 152.03515625)
[3956187.383] xdg_wm_base@14.ping(27292125)
[3956187.429]  -> xdg_wm_base@14.pong(27292125)
[3956189.048] wl_data_device@16.motion(27292125, 347.27734375, 149.15625000)
[3956195.487] xdg_wm_base@14.ping(27292133)
[3956195.539]  -> xdg_wm_base@14.pong(27292133)
[3956198.701] wl_data_device@16.motion(27292133, 344.53125000, 146.41406250)
[3956203.453] xdg_wm_base@14.ping(27292141)
[3956203.513]  -> xdg_wm_base@14.pong(27292141)
[3956204.947] wl_data_device@16.motion(27292141, 341.96093750, 143.84375000)
[3956211.387] xdg_wm_base@14.ping(27292149)
[3956211.432]  -> xdg_wm_base@14.pong(27292149)
[3956215.025] wl_data_device@16.motion(27292149, 340.83203125, 142.71484375)
[3956219.439] xdg_wm_base@14.ping(27292157)
[3956219.492]  -> xdg_wm_base@14.pong(27292157)
[3956221.246] wl_data_device@16.motion(27292157, 339.83203125, 141.71484375)
[3956442.130] wl_data_device@16.drop()
error marshalling arguments for receive (signature sh): null value passed for arg 0
Error marshalling request: Invalid argument
 err: wayland.c:1169: failed to dispatch pending Wayland events: Invalid argument
 err: wayland.c:1690: failed to roundtrip Wayland display: Invalid argument
 err: wayland.c:1690: failed to roundtrip Wayland display: Invalid argument
 err: wayland.c:1690: failed to roundtrip Wayland display: Invalid argument
warn: terminal.c:1769: slave exited with signal 15 (Terminated)
 err: wayland.c:1655: failed to flush wayland socket: Invalid argument
warn: fdm.c:112: FD list not empty
info: main.c:680: goodbye
This is the output with `WAYLAND_DEBUG=1`. Do you think I should file a bug with libwayland instead? ``` ... [3956181.401] -> xdg_wm_base@14.pong(27292117) [3956184.633] wl_data_device@16.motion(27292117, 351.59375000, 152.03515625) [3956187.383] xdg_wm_base@14.ping(27292125) [3956187.429] -> xdg_wm_base@14.pong(27292125) [3956189.048] wl_data_device@16.motion(27292125, 347.27734375, 149.15625000) [3956195.487] xdg_wm_base@14.ping(27292133) [3956195.539] -> xdg_wm_base@14.pong(27292133) [3956198.701] wl_data_device@16.motion(27292133, 344.53125000, 146.41406250) [3956203.453] xdg_wm_base@14.ping(27292141) [3956203.513] -> xdg_wm_base@14.pong(27292141) [3956204.947] wl_data_device@16.motion(27292141, 341.96093750, 143.84375000) [3956211.387] xdg_wm_base@14.ping(27292149) [3956211.432] -> xdg_wm_base@14.pong(27292149) [3956215.025] wl_data_device@16.motion(27292149, 340.83203125, 142.71484375) [3956219.439] xdg_wm_base@14.ping(27292157) [3956219.492] -> xdg_wm_base@14.pong(27292157) [3956221.246] wl_data_device@16.motion(27292157, 339.83203125, 141.71484375) [3956442.130] wl_data_device@16.drop() error marshalling arguments for receive (signature sh): null value passed for arg 0 Error marshalling request: Invalid argument err: wayland.c:1169: failed to dispatch pending Wayland events: Invalid argument err: wayland.c:1690: failed to roundtrip Wayland display: Invalid argument err: wayland.c:1690: failed to roundtrip Wayland display: Invalid argument err: wayland.c:1690: failed to roundtrip Wayland display: Invalid argument warn: terminal.c:1769: slave exited with signal 15 (Terminated) err: wayland.c:1655: failed to flush wayland socket: Invalid argument warn: fdm.c:112: FD list not empty info: main.c:680: goodbye ```
Owner

Not sure yet. Can you please attach the full log output. What you pasted does not include the start of the drag-and-drop.

Not sure yet. Can you please attach the full log output. What you pasted does not include the start of the drag-and-drop.
Owner

Without the full log output, the patch below is really just a guess... it may or may not fix the problem. But even if it does appear to fix the problem, I'd still like to see the full log output.

But, here goes anyway; can you try this patch?

diff --git a/selection.c b/selection.c
index 37dd2c8d..f2731dcc 100644
--- a/selection.c
+++ b/selection.c
@@ -2392,6 +2392,9 @@ drop(void *data, struct wl_data_device *wl_data_device)
 
     struct wl_clipboard *clipboard = &seat->clipboard;
 
+    if (clipboard->mime_type == DATA_OFFER_MIME_UNSET)
+        return;
+
     struct dnd_context *ctx = xmalloc(sizeof(*ctx));
     *ctx = (struct dnd_context){
         .term = term,
Without the full log output, the patch below is really just a guess... it may or may not fix the problem. But even if it _does_ appear to fix the problem, I'd still like to see the full log output. But, here goes anyway; can you try this patch? ```diff diff --git a/selection.c b/selection.c index 37dd2c8d..f2731dcc 100644 --- a/selection.c +++ b/selection.c @@ -2392,6 +2392,9 @@ drop(void *data, struct wl_data_device *wl_data_device) struct wl_clipboard *clipboard = &seat->clipboard; + if (clipboard->mime_type == DATA_OFFER_MIME_UNSET) + return; + struct dnd_context *ctx = xmalloc(sizeof(*ctx)); *ctx = (struct dnd_context){ .term = term, ```
Poster

Thanks! I will try the patch and respond back. I attached the full log output.

Thanks! I will try the patch and respond back. I attached the full log output.
Owner

Thanks!

Here's the source of the problem (and yes, this is an issue in foot):

wl_data_offer@4278190082.offer("application/x-gimp-image-id")
[ 924777.656] wl_data_offer@4278190082.offer("image/png")
[ 924777.661] wl_data_offer@4278190082.offer("image/bmp")
[ 924777.666] wl_data_offer@4278190082.offer("image/x-bmp")
[ 924777.675] wl_data_offer@4278190082.offer("image/x-MS-bmp")
[ 924777.679] wl_data_offer@4278190082.offer("image/x-ico")
[ 924777.687] wl_data_offer@4278190082.offer("image/x-win-bitmap")
[ 924777.696] wl_data_offer@4278190082.offer("image/vnd.microsoft.icon")
[ 924777.706] wl_data_offer@4278190082.offer("application/ico")
[ 924777.719] wl_data_offer@4278190082.offer("image/ico")
[ 924777.726] wl_data_offer@4278190082.offer("image/icon")
[ 924777.735] wl_data_offer@4278190082.offer("text/ico")
[ 924777.742] wl_data_offer@4278190082.offer("image/tiff")
[ 924777.746] wl_data_offer@4278190082.offer("image/jpeg")
[ 924777.751] wl_data_offer@4278190082.action(0)
[ 924777.756] wl_data_offer@4278190082.source_actions(7)
[ 924777.760] wl_data_device@16.enter(61732, wl_surface@3, 682.85546875, 251.08593750, wl_data_offer@4278190082)
[ 924777.776]  -> wl_data_offer@4278190082.accept(61732, nil)

None of these mime types are supported by foot. This means, internally, we have a NULL mime-type.

Then, in drop(), we call wl_data_offer_receive() with that NULL mime-type. That's what causes libwayland to bail out.

We're already dealing with unsupported mime-types in regular copy-paste operations (by ignoring them), but not in drag-and-drop.

The patch I posted above should be the correct way to handle this. Let me know if it works or not!

Thanks! Here's the source of the problem (and yes, this _is_ an issue in foot): ``` wl_data_offer@4278190082.offer("application/x-gimp-image-id") [ 924777.656] wl_data_offer@4278190082.offer("image/png") [ 924777.661] wl_data_offer@4278190082.offer("image/bmp") [ 924777.666] wl_data_offer@4278190082.offer("image/x-bmp") [ 924777.675] wl_data_offer@4278190082.offer("image/x-MS-bmp") [ 924777.679] wl_data_offer@4278190082.offer("image/x-ico") [ 924777.687] wl_data_offer@4278190082.offer("image/x-win-bitmap") [ 924777.696] wl_data_offer@4278190082.offer("image/vnd.microsoft.icon") [ 924777.706] wl_data_offer@4278190082.offer("application/ico") [ 924777.719] wl_data_offer@4278190082.offer("image/ico") [ 924777.726] wl_data_offer@4278190082.offer("image/icon") [ 924777.735] wl_data_offer@4278190082.offer("text/ico") [ 924777.742] wl_data_offer@4278190082.offer("image/tiff") [ 924777.746] wl_data_offer@4278190082.offer("image/jpeg") [ 924777.751] wl_data_offer@4278190082.action(0) [ 924777.756] wl_data_offer@4278190082.source_actions(7) [ 924777.760] wl_data_device@16.enter(61732, wl_surface@3, 682.85546875, 251.08593750, wl_data_offer@4278190082) [ 924777.776] -> wl_data_offer@4278190082.accept(61732, nil) ``` None of these mime types are supported by foot. This means, internally, we have a `NULL` mime-type. Then, in `drop()`, we call `wl_data_offer_receive()` with that `NULL` mime-type. That's what causes libwayland to bail out. We're already dealing with unsupported mime-types in regular copy-paste operations (by ignoring them), but not in drag-and-drop. The patch I posted above _should_ be the correct way to handle this. Let me know if it works or not!
dnkl added the
bug
label 5 months ago
Poster

can you try this patch?

The patch fixed it. foot is no longer crashing.

The funny thing is that Firefox (or libwayland?) still behaves strangely when a tab is dropped over foot: the tab bar seems to get stuck in the drag and drop operation (leaving the tab bar unresponsive) while the tab is not being detached from the main window.

Dragging a tab from Firefox over Gnome Terminal detaches the tab as expected and creates a new window.

> can you try this patch? The patch fixed it. foot is no longer crashing. The funny thing is that Firefox (or libwayland?) still behaves strangely when a tab is dropped over foot: the tab bar seems to get stuck in the drag and drop operation (leaving the tab bar unresponsive) while the tab is not being detached from the main window. Dragging a tab from Firefox over Gnome Terminal detaches the tab as expected and creates a new window.
Owner

The funny thing is that Firefox (or libwayland?) still behaves strangely when a tab is dropped over foot: the tab bar seems to get stuck in the drag and drop operation (leaving the tab bar unresponsive) while the tab is not being detached from the main window.

That smells like a GNOME bug.

From the documentation of the "data offer" protocol:

* For objects of version 3 or newer, this request determines the
* final result of the drag-and-drop operation. If the end result
* is that no mime types were accepted, the drag-and-drop operation
* will be cancelled and the corresponding drag source will receive
* wl_data_source.cancelled. Clients may still use this event in
* conjunction with wl_data_source.action for feedback.

That is, if the client (foot), calls wl_data_offer_accept() with a NULL mime-type, the end result is that no mime types were accepted.

This is exactly what foot does:

[ 924777.776]  -> wl_data_offer@4278190082.accept(61732, nil)

And, your version of GNOME implements version 3 of this protocol:

[ 913391.054] wl_registry@2.global(7, "wl_data_device_manager", 3)

The problem here is that GNOME should realize that foot doesn't support this drag-and-drop operation (and, I assume, behave as if you had dropped it on the desktop instead).

This also lines up with the drop() callback being called in foot. I'm not seeing that happening in Sway or river, but we are seeing it happen for you. And it shouldn't.

That said, I have two different patches you can try (one at a time), that may work:

Alternative #1

diff --git a/selection.c b/selection.c
index f2731dcc..018418d3 100644
--- a/selection.c
+++ b/selection.c
@@ -2330,10 +2330,13 @@ enter(void *data, struct wl_data_device *wl_data_device, uint32_t serial,
         {
             wl_data_offer_accept(
                 offer, serial, mime_type_map[seat->clipboard.mime_type]);
-            wl_data_offer_set_actions(
-                offer,
-                WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY,
-                WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY);
+
+            if (seat->clipboard.mime_type != DATA_OFFER_MIME_UNSET) {
+                wl_data_offer_set_actions(
+                    offer,
+                    WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY,
+                    WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY);
+            }
 
             seat->clipboard.window = it->item->window;
             return;

Alternative #2

diff --git a/selection.c b/selection.c
index f2731dcc..1f914124 100644
--- a/selection.c
+++ b/selection.c
@@ -2330,10 +2330,18 @@ enter(void *data, struct wl_data_device *wl_data_device, uint32_t serial,
         {
             wl_data_offer_accept(
                 offer, serial, mime_type_map[seat->clipboard.mime_type]);
-            wl_data_offer_set_actions(
-                offer,
-                WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY,
-                WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY);
+
+            if (seat->clipboard.mime_type != DATA_OFFER_MIME_UNSET) {
+                wl_data_offer_set_actions(
+                    offer,
+                    WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY,
+                    WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY);
+            } else {
+                wl_data_offer_set_actions(
+                    offer,
+                    WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE,
+                    WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE);
+            }
 
             seat->clipboard.window = it->item->window;
             return;
> The funny thing is that Firefox (or libwayland?) still behaves strangely when a tab is dropped over foot: the tab bar seems to get stuck in the drag and drop operation (leaving the tab bar unresponsive) while the tab is not being detached from the main window. That smells like a GNOME bug. From the documentation of the _"data offer"_ protocol: > ``` > * For objects of version 3 or newer, this request determines the > * final result of the drag-and-drop operation. If the end result > * is that no mime types were accepted, the drag-and-drop operation > * will be cancelled and the corresponding drag source will receive > * wl_data_source.cancelled. Clients may still use this event in > * conjunction with wl_data_source.action for feedback. > ``` That is, if the client (foot), calls `wl_data_offer_accept()` with a NULL mime-type, the end result is that no mime types were accepted. This is exactly what foot does: ``` [ 924777.776] -> wl_data_offer@4278190082.accept(61732, nil) ``` And, your version of GNOME implements version 3 of this protocol: ``` [ 913391.054] wl_registry@2.global(7, "wl_data_device_manager", 3) ``` The problem here is that GNOME should realize that foot doesn't support this drag-and-drop operation (and, I assume, behave as if you had dropped it on the desktop instead). This also lines up with the `drop()` callback being called in foot. I'm not seeing that happening in Sway or river, but we **are** seeing it happen for you. And it shouldn't. That said, I have two different patches you can try (one at a time), that _may_ work: Alternative #1 ```diff diff --git a/selection.c b/selection.c index f2731dcc..018418d3 100644 --- a/selection.c +++ b/selection.c @@ -2330,10 +2330,13 @@ enter(void *data, struct wl_data_device *wl_data_device, uint32_t serial, { wl_data_offer_accept( offer, serial, mime_type_map[seat->clipboard.mime_type]); - wl_data_offer_set_actions( - offer, - WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY, - WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY); + + if (seat->clipboard.mime_type != DATA_OFFER_MIME_UNSET) { + wl_data_offer_set_actions( + offer, + WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY, + WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY); + } seat->clipboard.window = it->item->window; return; ``` Alternative #2 ```diff diff --git a/selection.c b/selection.c index f2731dcc..1f914124 100644 --- a/selection.c +++ b/selection.c @@ -2330,10 +2330,18 @@ enter(void *data, struct wl_data_device *wl_data_device, uint32_t serial, { wl_data_offer_accept( offer, serial, mime_type_map[seat->clipboard.mime_type]); - wl_data_offer_set_actions( - offer, - WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY, - WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY); + + if (seat->clipboard.mime_type != DATA_OFFER_MIME_UNSET) { + wl_data_offer_set_actions( + offer, + WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY, + WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY); + } else { + wl_data_offer_set_actions( + offer, + WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE, + WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE); + } seat->clipboard.window = it->item->window; return; ```
Owner

Can you tell me which version of GNOME you're running?

You see, now that I think back to when I tried to reproduce this on GNOME, and also putting everything else toghether, I believe that all issues mentioned here is really a single bug, in GNOME.

However, I also believe that it has been fixed in the latest version of GNOME.

I don't have access to a GNOME setup right now, but will run some more experiments tomorrow. If I'm right, then what I'll do is add a workaround to prevent foot from exiting, along with a warning stating the compositor is broken.

However, I will not try to add a workaround for the stuck drag-and-drop operation, since a) its (if I'm right) not foot's fault, and b) it's already been fixed in more recent versions of GNOME (again, if I'm right).

Can you tell me which version of GNOME you're running? You see, now that I think back to when I tried to reproduce this on GNOME, and also putting everything else toghether, I believe that all issues mentioned here is really a single bug, in GNOME. However, I also believe that it has been fixed in the latest version of GNOME. I don't have access to a GNOME setup right now, but will run some more experiments tomorrow. If I'm right, then what I'll do is add a workaround to prevent foot from exiting, along with a warning stating the compositor is broken. However, I will not try to add a workaround for the stuck drag-and-drop operation, since a) its (if I'm right) not foot's fault, and b) it's already been fixed in more recent versions of GNOME (again, if I'm right).
Owner

#1093 implements the workaround for foot exiting, and also ensures we reject drag-and-drop offers whenever we can't, or won't accept it. This can be either because we don't support the mime-type, or because the offer is for a surface where we don't support a drop (the CSDs for example).

https://codeberg.org/dnkl/foot/pulls/1093 implements the workaround for foot exiting, and also ensures we reject drag-and-drop offers whenever we can't, or won't accept it. This can be either because we don't support the mime-type, or because the offer is for a surface where we don't support a drop (the CSDs for example).
Poster

How you're describing it, I think I understand the problem now. I'm using gnome-shell-42.2-1.fc36 and libwayland 1.20.0-4.fc36.

I compiled foot with both patches separately (without the one from this comment) and both made Firefox detach the tab flawlessly without breaking the tab bar.

Thank you very much for taking your time to help me out with this!

How you're describing it, I think I understand the problem now. I'm using `gnome-shell-42.2-1.fc36` and `libwayland 1.20.0-4.fc36`. I compiled foot with both patches separately (without the one from [this comment](https://codeberg.org/dnkl/foot/issues/1092#issuecomment-476476)) and both made Firefox detach the tab flawlessly without breaking the tab bar. Thank you very much for taking your time to help me out with this!
Owner

Hmm, that's the same version I'm running. Weird that we're seeing different behavior...

But then I run it nested inside my normal compositor, and very stripped down.

In any case, could you try #1093 ?

That's the cleaned up version, and what I intend to go with.

Hmm, that's the same version I'm running. Weird that we're seeing different behavior... But then I run it nested inside my normal compositor, and very stripped down. In any case, could you try https://codeberg.org/dnkl/foot/pulls/1093 ? That's the cleaned up version, and what I intend to go with.
dnkl closed this issue 5 months ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: dnkl/foot#1092
Loading…
There is no content yet.