{"record":{"id":"883fe99c4a8e74e5","repo":"kovidgoyal/kitty","slug":"failed-to-start-window-drag-e","errorCode":null,"errorMessage":"Failed to start window drag: {e}","messagePattern":"Failed to start window drag: (.+?)","errorType":"console","errorClass":"OSError","httpStatus":null,"severity":"warning","filePath":"kitty/tabs.py","lineNumber":2037,"sourceCode":"        min_w = opts.window_title_bar_min_windows\n        for tm in boss.all_tab_managers:\n            tm.mark_tab_bar_dirty()\n            for t in tm:\n                visible = sum(1 for _ in t.windows.iter_all_layoutable_groups(only_visible=True))\n                if not (min_w > 0 and visible >= min_w):\n                    t.force_show_title_bars = True\n                    t.relayout()\n        title = str(w.title or '')\n        fg = color_as_int(opts.window_title_bar_active_foreground or opts.active_tab_foreground)\n        bg = color_as_int(opts.window_title_bar_active_background or opts.active_tab_background)\n        title_pixels, width = draw_single_line_of_text(self.os_window_id, title, 0xFF000000 | fg, 0xFF000000 | bg, width)\n        title_height = len(title_pixels) // (width * 4)\n        thumbnails = ((title_pixels + pixels, width, title_height + height),)\n        drag_data = {f'application/net.kovidgoyal.kitty-window-{os.getpid()}': str(window_id).encode()}\n        try:\n            start_drag_with_data(self.os_window_id, drag_data, thumbnails)\n        except OSError as e:\n            log_error(f'Failed to start window drag: {e}')\n            set_window_being_dragged()\n            self._clear_force_show_title_bars()\n\n    def _set_drag_target_tab(self, tab_id: int) -> None:\n        if self.window_drag_target_tab_id == tab_id:\n            return\n        self.window_drag_target_tab_id = tab_id\n        self.mark_tab_bar_dirty()\n\n    def _clear_force_show_title_bars(self) -> None:\n        boss = get_boss()\n        for tm in boss.all_tab_managers:\n            tm._set_drag_target_window(0)\n            tm._set_drag_target_tab(0)\n            for tab in tm:\n                if tab.force_show_title_bars:\n                    tab.force_show_title_bars = False\n                    tab.relayout()","sourceCodeStart":2019,"sourceCodeEnd":2055,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/tabs.py#L2019-L2055","documentation":"Starting a native window drag (dragging a kitty window out of the OS window) failed with an OSError from the platform backend; kitty resets the window-drag state.","triggerScenarios":"start_drag_with_data raises OSError in the window-drag branch in tabs.py, e.g. compositor rejecting the net.kitty-window mime drag.","commonSituations":"Same class of issue as tab drags: Wayland compositors with limited drag-and-drop, unusual GPU/driver setups, or nested kitty instances.","solutions":["Use kitten @new-window / launch --copy-env or :detach-window instead of native drag","Update compositor and kitty; check kitty release notes for drag fixes","Report with the OSError details if reproducible"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use launch --copy-env / :detach-window --target-tab as keyboard-driven alternatives to dragging windows","Update compositor and kitty if native window drags fail"],"tags":["kitty","drag-and-drop","window-management","wayland"],"backgroundTag":"drag-and-drop-unsupported","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}