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
This commit is contained in:
Kovid Goyal
2024-07-09 08:02:10 +05:30
parent 076c882b22
commit ee7afeea5a
2 changed files with 1 additions and 9 deletions

View File

@@ -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);