Wayland: Fix fallback decoration scroll events

The fallback decorations would emit scroll events as if scrolling had
occurred over the content area of the window.
This commit is contained in:
Camilla Löwy 2025-07-18 16:35:57 +02:00
parent 645a35a38e
commit 161fb1b6f6
2 changed files with 9 additions and 5 deletions

View File

@ -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`

View File

@ -1636,11 +1636,14 @@ static void pointerHandleAxis(void* userData,
if (!window)
return;
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 =