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
51e99345
Commit
51e99345
authored
Feb 12, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Feb 12, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Always listen to XInput2 device changes events.
parent
b7867059
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
17 deletions
+24
-17
mouse.c
dlls/winex11.drv/mouse.c
+24
-17
No files found.
dlls/winex11.drv/mouse.c
View file @
51e99345
...
...
@@ -260,14 +260,10 @@ static void enable_xinput2(void)
{
struct
x11drv_thread_data
*
data
=
x11drv_thread_data
();
XIEventMask
mask
;
XIDeviceInfo
*
pointer_info
;
unsigned
char
mask_bits
[
XIMaskLen
(
XI_LASTEVENT
)];
int
count
;
if
(
!
xinput2_available
)
return
;
if
(
!
pXIGetClientPointer
(
data
->
display
,
None
,
&
data
->
xinput2_pointer
))
return
;
mask
.
mask
=
mask_bits
;
mask
.
mask_len
=
sizeof
(
mask_bits
);
mask
.
deviceid
=
XIAllMasterDevices
;
...
...
@@ -275,12 +271,7 @@ static void enable_xinput2(void)
XISetMask
(
mask_bits
,
XI_DeviceChanged
);
XISetMask
(
mask_bits
,
XI_RawMotion
);
XISetMask
(
mask_bits
,
XI_ButtonPress
);
pXISelectEvents
(
data
->
display
,
DefaultRootWindow
(
data
->
display
),
&
mask
,
1
);
pointer_info
=
pXIQueryDevice
(
data
->
display
,
data
->
xinput2_pointer
,
&
count
);
update_relative_valuators
(
pointer_info
->
classes
,
pointer_info
->
num_classes
);
pXIFreeDeviceInfo
(
pointer_info
);
}
#endif
...
...
@@ -292,20 +283,17 @@ static void disable_xinput2(void)
{
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
struct
x11drv_thread_data
*
data
=
x11drv_thread_data
();
unsigned
char
mask_bits
[
XIMaskLen
(
XI_LASTEVENT
)];
XIEventMask
mask
;
if
(
!
xinput2_available
)
return
;
mask
.
mask
=
NULL
;
mask
.
mask_len
=
0
;
mask
.
mask
=
mask_bits
;
mask
.
mask_len
=
sizeof
(
mask_bits
)
;
mask
.
deviceid
=
XIAllMasterDevices
;
memset
(
mask_bits
,
0
,
sizeof
(
mask_bits
)
);
XISetMask
(
mask_bits
,
XI_DeviceChanged
);
pXISelectEvents
(
data
->
display
,
DefaultRootWindow
(
data
->
display
),
&
mask
,
1
);
data
->
x_valuator
.
number
=
-
1
;
data
->
y_valuator
.
number
=
-
1
;
data
->
x_valuator
.
value
=
0
;
data
->
y_valuator
.
value
=
0
;
data
->
xinput2_pointer
=
0
;
#endif
}
...
...
@@ -316,7 +304,10 @@ static void disable_xinput2(void)
void
x11drv_xinput2_init
(
struct
x11drv_thread_data
*
data
)
{
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
unsigned
char
mask_bits
[
XIMaskLen
(
XI_LASTEVENT
)];
int
major
=
2
,
minor
=
2
;
XIEventMask
mask
;
int
count
;
if
(
!
xinput2_available
||
pXIQueryVersion
(
data
->
display
,
&
major
,
&
minor
))
{
...
...
@@ -325,6 +316,22 @@ void x11drv_xinput2_init( struct x11drv_thread_data *data )
return
;
}
mask
.
mask
=
mask_bits
;
mask
.
mask_len
=
sizeof
(
mask_bits
);
mask
.
deviceid
=
XIAllMasterDevices
;
memset
(
mask_bits
,
0
,
sizeof
(
mask_bits
)
);
XISetMask
(
mask_bits
,
XI_DeviceChanged
);
pXISelectEvents
(
data
->
display
,
DefaultRootWindow
(
data
->
display
),
&
mask
,
1
);
if
(
!
pXIGetClientPointer
(
data
->
display
,
None
,
&
data
->
xinput2_pointer
))
WARN
(
"Failed to get xinput2 master pointer device
\n
"
);
else
{
XIDeviceInfo
*
pointer_info
=
pXIQueryDevice
(
data
->
display
,
data
->
xinput2_pointer
,
&
count
);
update_relative_valuators
(
pointer_info
->
classes
,
pointer_info
->
num_classes
);
pXIFreeDeviceInfo
(
pointer_info
);
}
TRACE
(
"XInput2 %d.%d available
\n
"
,
major
,
minor
);
#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