diff --git a/README.md b/README.md index a3fd32b2..d1be3141 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,7 @@ information on what to include when reporting a bug. - [Wayland] Bugfix: Keyboard leave event handler now processes key repeats (#2736) - [Wayland] Bugfix: Retrieved cursor position would be incorrect when hovering over fallback decorations + - [Wayland] Bugfix: Fallback decorations would report scroll events - [X11] Bugfix: Running without a WM could trigger an assert (#2593,#2601,#2631) - [Null] Added Vulkan 'window' surface creation via `VK_EXT_headless_surface` - [Null] Added EGL context creation on Mesa via `EGL_MESA_platform_surfaceless` diff --git a/src/wl_window.c b/src/wl_window.c index 134ef6d1..0a6a8543 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1636,11 +1636,14 @@ static void pointerHandleAxis(void* userData, if (!window) return; - // NOTE: 10 units of motion per mouse wheel step seems to be a common ratio - if (axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL) - _glfwInputScroll(window, -wl_fixed_to_double(value) / 10.0, 0.0); - else if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL) - _glfwInputScroll(window, 0.0, -wl_fixed_to_double(value) / 10.0); + if (window->wl.hovered) + { + // NOTE: 10 units of motion per mouse wheel step seems to be a common ratio + if (axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL) + _glfwInputScroll(window, -wl_fixed_to_double(value) / 10.0, 0.0); + else if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL) + _glfwInputScroll(window, 0.0, -wl_fixed_to_double(value) / 10.0); + } } static const struct wl_pointer_listener pointerListener =