mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 08:26:56 +00:00
Fix spurious mouse release event during drag out of OS window
Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com> Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/f4f7b9e7-102b-4af7-aa03-4fb7a85d6ed0
This commit is contained in:
parent
79713b3ddf
commit
215bbf68de
2 changed files with 8 additions and 1 deletions
|
|
@ -186,6 +186,7 @@ Detailed list of changes
|
|||
|
||||
- The :opt:`show_hyperlink_targets` option now allows specifying a keyboard modifier so that target URLs are only shown on hover when the modifier is pressed (:pull:`9741`)
|
||||
|
||||
- Fix a spurious mouse button release event being sent when dragging out of an OS window causes focus loss
|
||||
|
||||
0.46.2 [2026-03-21]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
|
|||
8
glfw/window.c
vendored
8
glfw/window.c
vendored
|
|
@ -63,8 +63,14 @@ void _glfwInputWindowFocus(_GLFWwindow* window, bool focused)
|
|||
|
||||
for (int button = 0; button <= GLFW_MOUSE_BUTTON_LAST; button++)
|
||||
{
|
||||
if (window->mouseButtons[button] == GLFW_PRESS)
|
||||
if (window->mouseButtons[button] == GLFW_PRESS) {
|
||||
// Skip releasing the left mouse button when a drag is in
|
||||
// progress from this window to avoid spurious release events.
|
||||
// The release will be sent after the drag completes.
|
||||
if (button == GLFW_MOUSE_BUTTON_LEFT && _glfw.drag.window_id == window->id)
|
||||
continue;
|
||||
_glfwInputMouseClick(window, button, GLFW_RELEASE, 0);
|
||||
}
|
||||
}
|
||||
} else
|
||||
_glfw.focusedWindowId = window->id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue