mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 03:01:57 +02:00
Cancel momentum scroll on button and key events
This commit is contained in:
1
glfw/internal.h
vendored
1
glfw/internal.h
vendored
@@ -886,6 +886,7 @@ int _glfwPlatformSetWindowBlur(_GLFWwindow* handle, int value);
|
||||
MonitorGeometry _glfwPlatformGetMonitorGeometry(_GLFWmonitor* monitor);
|
||||
bool _glfwPlatformGrabKeyboard(bool grab);
|
||||
void glfw_handle_scroll_event_for_momentum(_GLFWwindow *w, const GLFWScrollEvent *ev, bool stopped, bool is_finger_based);
|
||||
#define glfw_cancel_momentum_scroll() glfw_handle_scroll_event_for_momentum(NULL, NULL, false, false)
|
||||
|
||||
char* _glfw_strdup(const char* source);
|
||||
|
||||
|
||||
2
glfw/wl_init.c
vendored
2
glfw/wl_init.c
vendored
@@ -135,6 +135,7 @@ static void pointerHandleButton(void* data UNUSED,
|
||||
uint32_t button,
|
||||
uint32_t state)
|
||||
{
|
||||
glfw_cancel_momentum_scroll();
|
||||
_glfw.wl.serial = serial; _glfw.wl.input_serial = serial; _glfw.wl.pointer_serial = serial;
|
||||
|
||||
_GLFWwindow* window = _glfw.wl.pointerFocus;
|
||||
@@ -395,6 +396,7 @@ static void keyboardHandleKey(void* data UNUSED,
|
||||
uint32_t key,
|
||||
uint32_t state)
|
||||
{
|
||||
glfw_cancel_momentum_scroll();
|
||||
_GLFWwindow* window = _glfwWindowForId(_glfw.wl.keyboardFocusId);
|
||||
if (!window)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user