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
b8b90e40
Commit
b8b90e40
authored
Aug 24, 2023
by
Alexandros Frantzis
Committed by
Alexandre Julliard
Sep 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winewayland.drv: Handle pointer button and scroll events.
parent
0d250de0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
wayland_pointer.c
dlls/winewayland.drv/wayland_pointer.c
+45
-0
No files found.
dlls/winewayland.drv/wayland_pointer.c
View file @
b8b90e40
...
...
@@ -24,6 +24,8 @@
#include "config.h"
#include <linux/input.h>
#undef SW_MAX
/* Also defined in winuser.rh */
#include <math.h>
#include "waylanddrv.h"
...
...
@@ -117,6 +119,26 @@ static void pointer_handle_button(void *data, struct wl_pointer *wl_pointer,
uint32_t
serial
,
uint32_t
time
,
uint32_t
button
,
uint32_t
state
)
{
INPUT
input
=
{
0
};
HWND
hwnd
;
if
(
!
(
hwnd
=
wayland_pointer_get_focused_hwnd
()))
return
;
input
.
type
=
INPUT_MOUSE
;
switch
(
button
)
{
case
BTN_LEFT
:
input
.
mi
.
dwFlags
=
MOUSEEVENTF_LEFTDOWN
;
break
;
case
BTN_RIGHT
:
input
.
mi
.
dwFlags
=
MOUSEEVENTF_RIGHTDOWN
;
break
;
case
BTN_MIDDLE
:
input
.
mi
.
dwFlags
=
MOUSEEVENTF_MIDDLEDOWN
;
break
;
default:
break
;
}
if
(
state
==
WL_POINTER_BUTTON_STATE_RELEASED
)
input
.
mi
.
dwFlags
<<=
1
;
TRACE
(
"hwnd=%p button=%#x state=%u
\n
"
,
hwnd
,
button
,
state
);
__wine_send_input
(
hwnd
,
&
input
,
NULL
);
}
static
void
pointer_handle_axis
(
void
*
data
,
struct
wl_pointer
*
wl_pointer
,
...
...
@@ -141,6 +163,29 @@ static void pointer_handle_axis_stop(void *data, struct wl_pointer *wl_pointer,
static
void
pointer_handle_axis_discrete
(
void
*
data
,
struct
wl_pointer
*
wl_pointer
,
uint32_t
axis
,
int32_t
discrete
)
{
INPUT
input
=
{
0
};
HWND
hwnd
;
if
(
!
(
hwnd
=
wayland_pointer_get_focused_hwnd
()))
return
;
input
.
type
=
INPUT_MOUSE
;
switch
(
axis
)
{
case
WL_POINTER_AXIS_VERTICAL_SCROLL
:
input
.
mi
.
dwFlags
=
MOUSEEVENTF_WHEEL
;
input
.
mi
.
mouseData
=
-
WHEEL_DELTA
*
discrete
;
break
;
case
WL_POINTER_AXIS_HORIZONTAL_SCROLL
:
input
.
mi
.
dwFlags
=
MOUSEEVENTF_HWHEEL
;
input
.
mi
.
mouseData
=
WHEEL_DELTA
*
discrete
;
break
;
default:
break
;
}
TRACE
(
"hwnd=%p axis=%u discrete=%d
\n
"
,
hwnd
,
axis
,
discrete
);
__wine_send_input
(
hwnd
,
&
input
,
NULL
);
}
static
const
struct
wl_pointer_listener
pointer_listener
=
...
...
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