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
b1368179
Commit
b1368179
authored
Dec 12, 2006
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Dec 13, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: Only events with MOUSEEVENTF_MOVE flag should change mouse position.
parent
5ff75115
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
5 deletions
+29
-5
input.c
dlls/user32/tests/input.c
+23
-2
mouse.c
dlls/winex11.drv/mouse.c
+6
-3
No files found.
dlls/user32/tests/input.c
View file @
b1368179
...
...
@@ -568,7 +568,7 @@ static LRESULT CALLBACK hook_proc2( int code, WPARAM wparam, LPARAM lparam )
if
(
code
==
HC_ACTION
)
{
ok
(
hook
->
pt
.
x
==
pt_new
.
x
&&
hook
->
pt
.
y
==
pt_new
.
y
,
"Wrong hook coords: (%d
,%d)
\n
"
,
pt_new
.
x
,
pt_new
.
y
);
"Wrong hook coords: (%d
%d) != (%d,%d)
\n
"
,
hook
->
pt
.
x
,
hook
->
pt
.
y
,
pt_new
.
x
,
pt_new
.
y
);
/* Should match position set above */
GetCursorPos
(
&
pt
);
...
...
@@ -582,7 +582,7 @@ static void test_mouse_ll_hook(void)
{
HWND
hwnd
;
HHOOK
hook1
,
hook2
;
POINT
pt_org
;
POINT
pt_org
,
pt
;
GetCursorPos
(
&
pt_org
);
hwnd
=
CreateWindow
(
"static"
,
"Title"
,
WS_OVERLAPPEDWINDOW
,
...
...
@@ -607,6 +607,27 @@ static void test_mouse_ll_hook(void)
ok
(
pt_old
.
x
==
pt_new
.
x
&&
pt_old
.
y
==
pt_new
.
y
,
"Wrong new pos: (%d,%d)
\n
"
,
pt_old
.
x
,
pt_old
.
y
);
UnhookWindowsHookEx
(
hook1
);
/* Now check that mouse buttons do not change mouse position
if we don't have MOUSEEVENTF_MOVE flag specified. */
/* We reusing the same hook callback, so make it happy */
pt_old
.
x
=
pt_new
.
x
-
STEP
;
pt_old
.
y
=
pt_new
.
y
-
STEP
;
mouse_event
(
MOUSEEVENTF_LEFTUP
,
123
,
456
,
0
,
0
);
GetCursorPos
(
&
pt
);
ok
(
pt
.
x
==
pt_new
.
x
&&
pt
.
y
==
pt_new
.
y
,
"Position changed: (%d,%d)
\n
"
,
pt
.
x
,
pt
.
y
);
mouse_event
(
MOUSEEVENTF_RIGHTUP
,
456
,
123
,
0
,
0
);
GetCursorPos
(
&
pt
);
ok
(
pt
.
x
==
pt_new
.
x
&&
pt
.
y
==
pt_new
.
y
,
"Position changed: (%d,%d)
\n
"
,
pt
.
x
,
pt
.
y
);
mouse_event
(
MOUSEEVENTF_LEFTUP
|
MOUSEEVENTF_ABSOLUTE
,
123
,
456
,
0
,
0
);
GetCursorPos
(
&
pt
);
ok
(
pt
.
x
==
pt_new
.
x
&&
pt
.
y
==
pt_new
.
y
,
"Position changed: (%d,%d)
\n
"
,
pt
.
x
,
pt
.
y
);
mouse_event
(
MOUSEEVENTF_RIGHTUP
|
MOUSEEVENTF_ABSOLUTE
,
456
,
123
,
0
,
0
);
GetCursorPos
(
&
pt
);
ok
(
pt
.
x
==
pt_new
.
x
&&
pt
.
y
==
pt_new
.
y
,
"Position changed: (%d,%d)
\n
"
,
pt
.
x
,
pt
.
y
);
UnhookWindowsHookEx
(
hook2
);
DestroyWindow
(
hwnd
);
SetCursorPos
(
pt_org
.
x
,
pt_org
.
y
);
...
...
dlls/winex11.drv/mouse.c
View file @
b1368179
...
...
@@ -216,7 +216,7 @@ void X11DRV_send_mouse_input( HWND hwnd, DWORD flags, DWORD x, DWORD y,
{
POINT
pt
;
if
(
flags
&
MOUSEEVENTF_ABSOLUTE
)
if
(
flags
&
MOUSEEVENTF_
MOVE
&&
flags
&
MOUSEEVENTF_
ABSOLUTE
)
{
if
(
injected_flags
&
LLMHF_INJECTED
)
{
...
...
@@ -227,6 +227,9 @@ void X11DRV_send_mouse_input( HWND hwnd, DWORD flags, DWORD x, DWORD y,
{
pt
.
x
=
x
;
pt
.
y
=
y
;
wine_tsx11_lock
();
if
(
cursor_pos
.
x
==
x
&&
cursor_pos
.
y
==
y
)
flags
&=
~
MOUSEEVENTF_MOVE
;
wine_tsx11_unlock
();
}
wine_tsx11_lock
();
cursor_pos
=
pt
;
...
...
@@ -748,7 +751,7 @@ void X11DRV_ButtonPress( HWND hwnd, XEvent *xev )
update_mouse_state
(
hwnd
,
event
->
window
,
event
->
x
,
event
->
y
,
event
->
state
,
&
pt
);
X11DRV_send_mouse_input
(
hwnd
,
button_down_flags
[
buttonNum
]
|
MOUSEEVENTF_ABSOLUTE
,
X11DRV_send_mouse_input
(
hwnd
,
button_down_flags
[
buttonNum
]
|
MOUSEEVENTF_ABSOLUTE
|
MOUSEEVENTF_MOVE
,
pt
.
x
,
pt
.
y
,
wData
,
EVENT_x11_time_to_win32_time
(
event
->
time
),
0
,
0
);
}
...
...
@@ -778,7 +781,7 @@ void X11DRV_ButtonRelease( HWND hwnd, XEvent *xev )
update_mouse_state
(
hwnd
,
event
->
window
,
event
->
x
,
event
->
y
,
event
->
state
,
&
pt
);
X11DRV_send_mouse_input
(
hwnd
,
button_up_flags
[
buttonNum
]
|
MOUSEEVENTF_ABSOLUTE
,
X11DRV_send_mouse_input
(
hwnd
,
button_up_flags
[
buttonNum
]
|
MOUSEEVENTF_ABSOLUTE
|
MOUSEEVENTF_MOVE
,
pt
.
x
,
pt
.
y
,
wData
,
EVENT_x11_time_to_win32_time
(
event
->
time
),
0
,
0
);
}
...
...
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