From ee7afeea5aad373a9deba22bc7068278619151d3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 9 Jul 2024 08:02:10 +0530 Subject: [PATCH] Remove workaround for kwin sending out of order events press/focus events on Wayland as it is not needed with up-to-date kwin and causes issues with multiple OS windows. The code wasnt correct anyway as active_draw_in_window was a window id and it was being compared to an OS window id. Fixes #7381 --- docs/changelog.rst | 1 + kitty/glfw.c | 9 --------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 50c1e8650..7d41cf1e8 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -88,6 +88,7 @@ Detailed list of changes - Dispatch any clicks waiting for :opt:`click_interval` on key events (:iss:`7601`) +- Wayland: Fix an issue with mouse selections not being stopped when there are multiple OS windows (:iss:`7381`) 0.35.2 [2024-06-22] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/glfw.c b/kitty/glfw.c index ff97d049e..7319820ff 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -515,15 +515,6 @@ static void window_focus_callback(GLFWwindow *w, int focused) { if (!set_callback_window(w)) return; debug_input("\x1b[35mon_focus_change\x1b[m: window id: 0x%llu focused: %d\n", global_state.callback_os_window->id, focused); - // There exist some numbnut Wayland compositors, like kwin, that send mouse - // press events before focus gained events. So only clear the active drag - // window if it is not the focused window. See https://github.com/kovidgoyal/kitty/issues/6095 - if ( - (!focused && global_state.callback_os_window->id == global_state.active_drag_in_window) || - (focused && global_state.callback_os_window->id != global_state.active_drag_in_window) - ) { - global_state.active_drag_in_window = 0; - } global_state.callback_os_window->is_focused = focused ? true : false; if (focused) { show_mouse_cursor(w);