Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pirvi-public
glfw
Commits
53b193a1
Commit
53b193a1
authored
Nov 29, 2017
by
Camilla Löwy
Browse files
Wayland: Fix uninitialized variable warning
Related to #1143. Fixes #1197.
parent
e9810216
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/wl_init.c
View file @
53b193a1
...
...
@@ -138,8 +138,11 @@ static void pointerHandleAxis(void* data,
wl_fixed_t
value
)
{
_GLFWwindow
*
window
=
_glfw
.
wl
.
pointerFocus
;
double
scrollFactor
;
double
x
,
y
;
double
x
=
0
.
0
,
y
=
0
.
0
;
// Wayland scroll events are in pointer motion coordinate space (think two
// finger scroll). The factor 10 is commonly used to convert to "scroll
// step means 1.0.
const
double
scrollFactor
=
1
.
0
/
10
.
0
;
if
(
!
window
)
return
;
...
...
@@ -147,22 +150,10 @@ static void pointerHandleAxis(void* data,
assert
(
axis
==
WL_POINTER_AXIS_HORIZONTAL_SCROLL
||
axis
==
WL_POINTER_AXIS_VERTICAL_SCROLL
);
/* Wayland scroll events are in pointer motion coordinate space (think
* two finger scroll). The factor 10 is commonly used to convert to
* "scroll step means 1.0. */
scrollFactor
=
1
.
0
/
10
.
0
;
switch
(
axis
)
{
case
WL_POINTER_AXIS_HORIZONTAL_SCROLL
:
x
=
wl_fixed_to_double
(
value
)
*
scrollFactor
;
y
=
0
.
0
;
break
;
case
WL_POINTER_AXIS_VERTICAL_SCROLL
:
x
=
0
.
0
;
y
=
wl_fixed_to_double
(
value
)
*
scrollFactor
;
break
;
}
if
(
axis
==
WL_POINTER_AXIS_HORIZONTAL_SCROLL
)
x
=
wl_fixed_to_double
(
value
)
*
scrollFactor
;
else
if
(
axis
==
WL_POINTER_AXIS_VERTICAL_SCROLL
)
y
=
wl_fixed_to_double
(
value
)
*
scrollFactor
;
_glfwInputScroll
(
window
,
x
,
y
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment