Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ff60249c
Commit
ff60249c
authored
Aug 15, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Use the labels to find the mouse motion valuators for XInput2.
parent
f5790913
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
23 deletions
+31
-23
mouse.c
dlls/winex11.drv/mouse.c
+27
-23
x11drv.h
dlls/winex11.drv/x11drv.h
+2
-0
x11drv_main.c
dlls/winex11.drv/x11drv_main.c
+2
-0
No files found.
dlls/winex11.drv/mouse.c
View file @
ff60249c
...
...
@@ -257,7 +257,7 @@ static void enable_xinput2(void)
XIEventMask
mask
;
XIDeviceInfo
*
devices
;
unsigned
char
mask_bits
[
XIMaskLen
(
XI_LASTEVENT
)];
int
i
,
j
;
int
i
,
j
,
count
;
if
(
!
xinput2_available
)
return
;
...
...
@@ -279,21 +279,18 @@ static void enable_xinput2(void)
for
(
i
=
0
;
i
<
data
->
xi2_device_count
;
++
i
)
{
if
(
devices
[
i
].
use
!=
XIMasterPointer
)
continue
;
for
(
j
=
0
;
j
<
devices
[
i
].
num_classes
;
j
++
)
for
(
j
=
count
=
0
;
j
<
devices
[
i
].
num_classes
;
j
++
)
{
XIValuatorClassInfo
*
class
=
(
XIValuatorClassInfo
*
)
devices
[
i
].
classes
[
j
];
if
(
devices
[
i
].
classes
[
j
]
->
type
!=
XIValuatorClass
)
continue
;
if
(
class
->
number
!=
0
&&
class
->
number
!=
1
)
continue
;
TRACE
(
"Device %u (%s) class %u num %u %f,%f res %u mode %u
\n
"
,
TRACE
(
"Device %u (%s) num %u %f,%f res %u mode %u label %s
\n
"
,
devices
[
i
].
deviceid
,
debugstr_a
(
devices
[
i
].
name
),
j
,
class
->
number
,
class
->
min
,
class
->
max
,
class
->
resolution
,
class
->
mode
);
if
(
class
->
mode
==
XIModeAbsolute
)
{
TRACE
(
"Device is absolute, not enabling XInput2
\n
"
);
goto
done
;
}
class
->
number
,
class
->
min
,
class
->
max
,
class
->
resolution
,
class
->
mode
,
XGetAtomName
(
data
->
display
,
class
->
label
));
if
(
class
->
label
==
x11drv_atom
(
Rel_X
)
||
class
->
label
==
x11drv_atom
(
Rel_Y
))
count
++
;
}
if
(
count
<
2
)
continue
;
TRACE
(
"Using %u (%s) as core pointer
\n
"
,
devices
[
i
].
deviceid
,
debugstr_a
(
devices
[
i
].
name
)
);
data
->
xi2_core_pointer
=
devices
[
i
].
deviceid
;
...
...
@@ -318,7 +315,6 @@ static void enable_xinput2(void)
}
}
done:
wine_tsx11_unlock
();
#endif
}
...
...
@@ -1523,11 +1519,8 @@ static void X11DRV_RawMotion( XGenericEventCookie *xev )
input
.
u
.
mi
.
dwFlags
=
MOUSEEVENTF_MOVE
;
input
.
u
.
mi
.
time
=
EVENT_x11_time_to_win32_time
(
event
->
time
);
input
.
u
.
mi
.
dwExtraInfo
=
0
;
if
(
XIMaskIsSet
(
event
->
valuators
.
mask
,
0
))
dx
=
*
values
++
;
if
(
XIMaskIsSet
(
event
->
valuators
.
mask
,
1
))
dy
=
*
values
++
;
input
.
u
.
mi
.
dx
=
dx
;
input
.
u
.
mi
.
dy
=
dy
;
input
.
u
.
mi
.
dx
=
0
;
input
.
u
.
mi
.
dy
=
0
;
wine_tsx11_lock
();
for
(
i
=
0
;
i
<
thread_data
->
xi2_device_count
;
++
i
)
...
...
@@ -1538,13 +1531,24 @@ static void X11DRV_RawMotion( XGenericEventCookie *xev )
XIValuatorClassInfo
*
class
=
(
XIValuatorClassInfo
*
)
devices
[
i
].
classes
[
j
];
if
(
devices
[
i
].
classes
[
j
]
->
type
!=
XIValuatorClass
)
continue
;
if
(
class
->
min
>=
class
->
max
)
continue
;
if
(
class
->
number
==
0
)
input
.
u
.
mi
.
dx
=
dx
*
(
virtual_screen_rect
.
right
-
virtual_screen_rect
.
left
)
/
(
class
->
max
-
class
->
min
);
else
if
(
class
->
number
==
1
)
input
.
u
.
mi
.
dy
=
dy
*
(
virtual_screen_rect
.
bottom
-
virtual_screen_rect
.
top
)
/
(
class
->
max
-
class
->
min
);
if
(
XIMaskIsSet
(
event
->
valuators
.
mask
,
class
->
number
))
{
double
val
=
*
values
++
;
if
(
class
->
label
==
x11drv_atom
(
Rel_X
))
{
input
.
u
.
mi
.
dx
=
dx
=
val
;
if
(
class
->
min
<
class
->
max
)
input
.
u
.
mi
.
dx
=
val
*
(
virtual_screen_rect
.
right
-
virtual_screen_rect
.
left
)
/
(
class
->
max
-
class
->
min
);
}
else
if
(
class
->
label
==
x11drv_atom
(
Rel_Y
))
{
input
.
u
.
mi
.
dy
=
dy
=
val
;
if
(
class
->
min
<
class
->
max
)
input
.
u
.
mi
.
dy
=
val
*
(
virtual_screen_rect
.
bottom
-
virtual_screen_rect
.
top
)
/
(
class
->
max
-
class
->
min
);
}
}
}
break
;
}
...
...
dlls/winex11.drv/x11drv.h
View file @
ff60249c
...
...
@@ -407,6 +407,8 @@ enum x11drv_atoms
XATOM_RAW_ASCENT
,
XATOM_RAW_DESCENT
,
XATOM_RAW_CAP_HEIGHT
,
XATOM_Rel_X
,
XATOM_Rel_Y
,
XATOM_WM_PROTOCOLS
,
XATOM_WM_DELETE_WINDOW
,
XATOM_WM_STATE
,
...
...
dlls/winex11.drv/x11drv_main.c
View file @
ff60249c
...
...
@@ -127,6 +127,8 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] =
"RAW_ASCENT"
,
"RAW_DESCENT"
,
"RAW_CAP_HEIGHT"
,
"Rel X"
,
"Rel Y"
,
"WM_PROTOCOLS"
,
"WM_DELETE_WINDOW"
,
"WM_STATE"
,
...
...
Write
Preview
Markdown
is supported
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