mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-21 12:42:25 +00:00
...
This commit is contained in:
parent
a9261fe529
commit
f8426d529c
1 changed files with 7 additions and 7 deletions
14
glfw/x11_init.c
vendored
14
glfw/x11_init.c
vendored
|
|
@ -192,14 +192,14 @@ static bool initExtensions(void)
|
|||
&_glfw.x11.xi.minor) == Success)
|
||||
{
|
||||
_glfw.x11.xi.available = true;
|
||||
|
||||
|
||||
// Detect smooth scrolling support once globally
|
||||
_glfw.x11.xi.smoothScroll.available = false;
|
||||
_glfw.x11.xi.smoothScroll.verticalAxis = -1;
|
||||
_glfw.x11.xi.smoothScroll.horizontalAxis = -1;
|
||||
_glfw.x11.xi.smoothScroll.verticalIncrement = 0.0;
|
||||
_glfw.x11.xi.smoothScroll.horizontalIncrement = 0.0;
|
||||
|
||||
|
||||
// Require XI2.1 or later for smooth scrolling
|
||||
if (_glfw.x11.xi.major >= 2 && (_glfw.x11.xi.major > 2 || _glfw.x11.xi.minor >= 1))
|
||||
{
|
||||
|
|
@ -212,7 +212,7 @@ static bool initExtensions(void)
|
|||
for (int i = 0; i < deviceCount; i++)
|
||||
{
|
||||
XIDeviceInfo* device = &devices[i];
|
||||
|
||||
|
||||
// Only process master pointer devices
|
||||
if (device->use != XIMasterPointer)
|
||||
continue;
|
||||
|
|
@ -223,7 +223,7 @@ static bool initExtensions(void)
|
|||
continue;
|
||||
|
||||
XIScrollClassInfo* scroll = (XIScrollClassInfo*)device->classes[j];
|
||||
|
||||
|
||||
if (scroll->scroll_type == XIScrollTypeVertical)
|
||||
{
|
||||
_glfw.x11.xi.smoothScroll.verticalAxis = scroll->number;
|
||||
|
|
@ -236,11 +236,11 @@ static bool initExtensions(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XIFreeDeviceInfo(devices);
|
||||
|
||||
|
||||
// Enable smooth scrolling if we found at least one scroll axis
|
||||
if (_glfw.x11.xi.smoothScroll.verticalAxis >= 0 ||
|
||||
if (_glfw.x11.xi.smoothScroll.verticalAxis >= 0 ||
|
||||
_glfw.x11.xi.smoothScroll.horizontalAxis >= 0)
|
||||
{
|
||||
_glfw.x11.xi.smoothScroll.available = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue