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
bab85038
Commit
bab85038
authored
Apr 27, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Merge consecutive RawMotion events.
parent
da9922b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
event.c
dlls/winex11.drv/event.c
+44
-0
No files found.
dlls/winex11.drv/event.c
View file @
bab85038
...
...
@@ -246,6 +246,46 @@ enum event_merge_action
};
/***********************************************************************
* merge_raw_motion_events
*/
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
static
enum
event_merge_action
merge_raw_motion_events
(
XIRawEvent
*
prev
,
XIRawEvent
*
next
)
{
int
i
,
j
,
k
;
unsigned
char
mask
;
if
(
!
prev
->
valuators
.
mask_len
)
return
MERGE_HANDLE
;
if
(
!
next
->
valuators
.
mask_len
)
return
MERGE_HANDLE
;
mask
=
prev
->
valuators
.
mask
[
0
]
|
next
->
valuators
.
mask
[
0
];
if
(
mask
==
next
->
valuators
.
mask
[
0
])
/* keep next */
{
for
(
i
=
j
=
k
=
0
;
i
<
8
;
i
++
)
{
if
(
XIMaskIsSet
(
prev
->
valuators
.
mask
,
i
))
next
->
valuators
.
values
[
j
]
+=
prev
->
valuators
.
values
[
k
++
];
if
(
XIMaskIsSet
(
next
->
valuators
.
mask
,
i
))
j
++
;
}
TRACE
(
"merging duplicate GenericEvent
\n
"
);
return
MERGE_DISCARD
;
}
if
(
mask
==
prev
->
valuators
.
mask
[
0
])
/* keep prev */
{
for
(
i
=
j
=
k
=
0
;
i
<
8
;
i
++
)
{
if
(
XIMaskIsSet
(
next
->
valuators
.
mask
,
i
))
prev
->
valuators
.
values
[
j
]
+=
next
->
valuators
.
values
[
k
++
];
if
(
XIMaskIsSet
(
prev
->
valuators
.
mask
,
i
))
j
++
;
}
TRACE
(
"merging duplicate GenericEvent
\n
"
);
return
MERGE_IGNORE
;
}
/* can't merge events with disjoint masks */
return
MERGE_HANDLE
;
}
#endif
/***********************************************************************
* merge_events
*
* Try to merge 2 consecutive events.
...
...
@@ -289,6 +329,10 @@ static enum event_merge_action merge_events( XEvent *prev, XEvent *next )
return
MERGE_IGNORE
;
}
break
;
case
GenericEvent
:
if
(
next
->
xcookie
.
extension
!=
xinput2_opcode
)
break
;
if
(
next
->
xcookie
.
evtype
!=
XI_RawMotion
)
break
;
return
merge_raw_motion_events
(
prev
->
xcookie
.
data
,
next
->
xcookie
.
data
);
}
break
;
#endif
...
...
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