Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
338fe8b9
Commit
338fe8b9
authored
Apr 13, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Add handlers for the XInput2 raw mouse events.
parent
77e05ce4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
117 additions
and
1 deletion
+117
-1
event.c
dlls/winex11.drv/event.c
+1
-1
mouse.c
dlls/winex11.drv/mouse.c
+115
-0
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-0
No files found.
dlls/winex11.drv/event.c
View file @
338fe8b9
...
@@ -140,7 +140,7 @@ static x11drv_event_handler handlers[MAX_EVENT_HANDLERS] =
...
@@ -140,7 +140,7 @@ static x11drv_event_handler handlers[MAX_EVENT_HANDLERS] =
NULL
,
/* 32 ColormapNotify */
NULL
,
/* 32 ColormapNotify */
X11DRV_ClientMessage
,
/* 33 ClientMessage */
X11DRV_ClientMessage
,
/* 33 ClientMessage */
X11DRV_MappingNotify
,
/* 34 MappingNotify */
X11DRV_MappingNotify
,
/* 34 MappingNotify */
NULL
/* 35 GenericEvent */
X11DRV_GenericEvent
/* 35 GenericEvent */
};
};
static
const
char
*
event_names
[
MAX_EVENT_HANDLERS
]
=
static
const
char
*
event_names
[
MAX_EVENT_HANDLERS
]
=
...
...
dlls/winex11.drv/mouse.c
View file @
338fe8b9
...
@@ -25,6 +25,9 @@
...
@@ -25,6 +25,9 @@
#include <X11/Xlib.h>
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
#include <X11/cursorfont.h>
#include <stdarg.h>
#include <stdarg.h>
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
#include <X11/extensions/XInput2.h>
#endif
#ifdef SONAME_LIBXCURSOR
#ifdef SONAME_LIBXCURSOR
# include <X11/Xcursor/Xcursor.h>
# include <X11/Xcursor/Xcursor.h>
...
@@ -1089,3 +1092,115 @@ void X11DRV_EnterNotify( HWND hwnd, XEvent *xev )
...
@@ -1089,3 +1092,115 @@ void X11DRV_EnterNotify( HWND hwnd, XEvent *xev )
send_mouse_input
(
hwnd
,
event
->
window
,
event
->
state
,
&
input
);
send_mouse_input
(
hwnd
,
event
->
window
,
event
->
state
,
&
input
);
}
}
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
/***********************************************************************
* X11DRV_RawButtonPress
*/
static
void
X11DRV_RawButtonPress
(
XIRawEvent
*
event
)
{
int
button
=
event
->
detail
-
1
;
INPUT
input
;
if
(
button
>=
NB_BUTTONS
)
return
;
TRACE
(
"button %u
\n
"
,
button
);
input
.
type
=
INPUT_MOUSE
;
input
.
u
.
mi
.
dx
=
0
;
input
.
u
.
mi
.
dy
=
0
;
input
.
u
.
mi
.
mouseData
=
button_down_data
[
button
];
input
.
u
.
mi
.
dwFlags
=
button_down_flags
[
button
];
input
.
u
.
mi
.
time
=
EVENT_x11_time_to_win32_time
(
event
->
time
);
input
.
u
.
mi
.
dwExtraInfo
=
0
;
update_user_time
(
event
->
time
);
input
.
type
=
INPUT_MOUSE
;
__wine_send_input
(
0
,
&
input
);
}
/***********************************************************************
* X11DRV_RawButtonRelease
*/
static
void
X11DRV_RawButtonRelease
(
XIRawEvent
*
event
)
{
int
button
=
event
->
detail
-
1
;
INPUT
input
;
if
(
button
>=
NB_BUTTONS
)
return
;
TRACE
(
"button %u
\n
"
,
button
);
input
.
u
.
mi
.
dx
=
0
;
input
.
u
.
mi
.
dy
=
0
;
input
.
u
.
mi
.
mouseData
=
button_up_data
[
button
];
input
.
u
.
mi
.
dwFlags
=
button_up_flags
[
button
];
input
.
u
.
mi
.
time
=
EVENT_x11_time_to_win32_time
(
event
->
time
);
input
.
u
.
mi
.
dwExtraInfo
=
0
;
input
.
type
=
INPUT_MOUSE
;
__wine_send_input
(
0
,
&
input
);
}
/***********************************************************************
* X11DRV_RawMotion
*/
static
void
X11DRV_RawMotion
(
XIRawEvent
*
event
)
{
const
double
*
values
=
event
->
valuators
.
values
;
INPUT
input
;
if
(
!
event
->
valuators
.
mask_len
)
return
;
input
.
u
.
mi
.
dx
=
0
;
input
.
u
.
mi
.
dy
=
0
;
input
.
u
.
mi
.
mouseData
=
0
;
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
))
input
.
u
.
mi
.
dx
=
*
values
++
;
if
(
XIMaskIsSet
(
event
->
valuators
.
mask
,
1
))
input
.
u
.
mi
.
dy
=
*
values
++
;
TRACE
(
"pos %d,%d
\n
"
,
input
.
u
.
mi
.
dx
,
input
.
u
.
mi
.
dy
);
input
.
type
=
INPUT_MOUSE
;
__wine_send_input
(
0
,
&
input
);
}
#endif
/* HAVE_X11_EXTENSIONS_XINPUT2_H */
/***********************************************************************
* X11DRV_GenericEvent
*/
void
X11DRV_GenericEvent
(
HWND
hwnd
,
XEvent
*
xev
)
{
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
XGenericEventCookie
*
event
=
&
xev
->
xcookie
;
if
(
!
event
->
data
)
return
;
switch
(
event
->
evtype
)
{
case
XI_RawButtonPress
:
X11DRV_RawButtonPress
(
event
->
data
);
break
;
case
XI_RawButtonRelease
:
X11DRV_RawButtonRelease
(
event
->
data
);
break
;
case
XI_RawMotion
:
X11DRV_RawMotion
(
event
->
data
);
break
;
default:
TRACE
(
"Unhandled event %#x
\n
"
,
event
->
evtype
);
break
;
}
#endif
}
dlls/winex11.drv/x11drv.h
View file @
338fe8b9
...
@@ -728,6 +728,7 @@ extern void X11DRV_DestroyNotify( HWND hwnd, XEvent *event );
...
@@ -728,6 +728,7 @@ extern void X11DRV_DestroyNotify( HWND hwnd, XEvent *event );
extern
void
X11DRV_SelectionRequest
(
HWND
hWnd
,
XEvent
*
event
);
extern
void
X11DRV_SelectionRequest
(
HWND
hWnd
,
XEvent
*
event
);
extern
void
X11DRV_SelectionClear
(
HWND
hWnd
,
XEvent
*
event
);
extern
void
X11DRV_SelectionClear
(
HWND
hWnd
,
XEvent
*
event
);
extern
void
X11DRV_MappingNotify
(
HWND
hWnd
,
XEvent
*
event
);
extern
void
X11DRV_MappingNotify
(
HWND
hWnd
,
XEvent
*
event
);
extern
void
X11DRV_GenericEvent
(
HWND
hwnd
,
XEvent
*
event
);
extern
Bool
(
*
pXGetEventData
)(
Display
*
display
,
XEvent
/*XGenericEventCookie*/
*
event
);
extern
Bool
(
*
pXGetEventData
)(
Display
*
display
,
XEvent
/*XGenericEventCookie*/
*
event
);
extern
void
(
*
pXFreeEventData
)(
Display
*
display
,
XEvent
/*XGenericEventCookie*/
*
event
);
extern
void
(
*
pXFreeEventData
)(
Display
*
display
,
XEvent
/*XGenericEventCookie*/
*
event
);
...
...
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