diff --git a/kitty/boss.py b/kitty/boss.py index 73244c76b..878d34e2d 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -1885,9 +1885,14 @@ def update_tab_bar_data(self, os_window_id: int) -> None: if tm is not None: tm.update_tab_bar_data() - def on_drop(self, os_window_id: int, drop: dict[str, bytes] | Exception, from_self: bool, x: int, y: int) -> None: - if isinstance(drop, Exception): - self.show_error(_('Drop failed'), str(drop)) + def on_drop(self, os_window_id: int, drop: dict[str, bytes] | int, from_self: bool, x: int, y: int) -> None: + if isinstance(drop, int): + import errno + code = errno.errorcode.get(drop, str(drop)) + msg = 'Unknown error' + with suppress(ValueError): + msg = os.strerror(drop) + self.show_error(_('Drop failed'), f'[{code}] {msg}') return if (tm := self.os_window_map.get(os_window_id)) is None: return diff --git a/kitty/glfw.c b/kitty/glfw.c index 8eeb6e865..0358c8bf1 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -1669,8 +1669,7 @@ create_os_window(PyObject UNUSED *self, PyObject *args, PyObject *kw) { glfwSetScrollCallback(glfw_window, scroll_callback); glfwSetKeyboardCallback(glfw_window, key_callback); - if (0) glfwSetDragSourceCallback(glfw_window, drag_source_callback); - + glfwSetDragSourceCallback(glfw_window, drag_source_callback); glfwSetDropEventCallback(glfw_window, on_drop); monotonic_t now = monotonic(); w->is_focused = true;