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
c0d0468d
Commit
c0d0468d
authored
Jan 28, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 06, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Select XI_Touch* input and translate it to WM_POINTER*.
parent
0f1322d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
mouse.c
dlls/winex11.drv/mouse.c
+50
-0
No files found.
dlls/winex11.drv/mouse.c
View file @
c0d0468d
...
...
@@ -273,6 +273,12 @@ void x11drv_xinput2_enable( Display *display, Window window )
XISetMask
(
mask_bits
,
XI_RawMotion
);
XISetMask
(
mask_bits
,
XI_ButtonPress
);
}
else
{
XISetMask
(
mask_bits
,
XI_TouchBegin
);
XISetMask
(
mask_bits
,
XI_TouchUpdate
);
XISetMask
(
mask_bits
,
XI_TouchEnd
);
}
pXISelectEvents
(
display
,
window
,
&
mask
,
1
);
}
...
...
@@ -1742,6 +1748,44 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
return
TRUE
;
}
static
BOOL
X11DRV_TouchEvent
(
HWND
hwnd
,
XGenericEventCookie
*
xev
)
{
RECT
virtual
=
NtUserGetVirtualScreenRect
();
INPUT
input
=
{.
type
=
INPUT_HARDWARE
};
XIDeviceEvent
*
event
=
xev
->
data
;
int
flags
=
0
;
POINT
pos
;
input
.
mi
.
dx
=
event
->
event_x
;
input
.
mi
.
dy
=
event
->
event_y
;
map_event_coords
(
hwnd
,
event
->
event
,
event
->
root
,
event
->
root_x
,
event
->
root_y
,
&
input
);
pos
.
x
=
input
.
mi
.
dx
*
65535
/
(
virtual
.
right
-
virtual
.
left
);
pos
.
y
=
input
.
mi
.
dy
*
65535
/
(
virtual
.
bottom
-
virtual
.
top
);
switch
(
event
->
evtype
)
{
case
XI_TouchBegin
:
input
.
hi
.
uMsg
=
WM_POINTERDOWN
;
flags
|=
POINTER_MESSAGE_FLAG_NEW
;
TRACE
(
"XI_TouchBegin detail %u pos %dx%d, flags %#x
\n
"
,
event
->
detail
,
(
int
)
pos
.
x
,
(
int
)
pos
.
y
,
flags
);
break
;
case
XI_TouchEnd
:
input
.
hi
.
uMsg
=
WM_POINTERUP
;
TRACE
(
"XI_TouchEnd detail %u pos %dx%d, flags %#x
\n
"
,
event
->
detail
,
(
int
)
pos
.
x
,
(
int
)
pos
.
y
,
flags
);
break
;
case
XI_TouchUpdate
:
input
.
hi
.
uMsg
=
WM_POINTERUPDATE
;
TRACE
(
"XI_TouchUpdate detail %u pos %dx%d, flags %#x
\n
"
,
event
->
detail
,
(
int
)
pos
.
x
,
(
int
)
pos
.
y
,
flags
);
break
;
}
input
.
hi
.
wParamL
=
event
->
detail
;
input
.
hi
.
wParamH
=
POINTER_MESSAGE_FLAG_INRANGE
|
POINTER_MESSAGE_FLAG_INCONTACT
|
flags
;
NtUserSendHardwareInput
(
hwnd
,
0
,
&
input
,
MAKELPARAM
(
pos
.
x
,
pos
.
y
)
);
return
TRUE
;
}
#endif
/* HAVE_X11_EXTENSIONS_XINPUT2_H */
...
...
@@ -1807,6 +1851,12 @@ BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *xev )
ret
=
X11DRV_RawMotion
(
event
);
break
;
case
XI_TouchBegin
:
case
XI_TouchUpdate
:
case
XI_TouchEnd
:
ret
=
X11DRV_TouchEvent
(
hwnd
,
event
);
break
;
default:
TRACE
(
"Unhandled event %#x
\n
"
,
event
->
evtype
);
break
;
...
...
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