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
99fda0a1
Commit
99fda0a1
authored
Dec 17, 2004
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Dec 17, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a mouse input test case, make the test pass under Wine.
parent
3b1a7a7a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
1 deletion
+66
-1
win.c
dlls/user/tests/win.c
+61
-0
mouse.c
dlls/x11drv/mouse.c
+5
-1
No files found.
dlls/user/tests/win.c
View file @
99fda0a1
...
...
@@ -2099,6 +2099,66 @@ static void test_keyboard_input(HWND hwnd)
ok
(
!
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"message %04x available
\n
"
,
msg
.
message
);
}
static
void
test_mouse_input
(
HWND
hwnd
)
{
RECT
rc
;
POINT
pt
;
int
x
,
y
;
HWND
popup
;
MSG
msg
;
ShowWindow
(
hwnd
,
SW_SHOW
);
UpdateWindow
(
hwnd
);
GetWindowRect
(
hwnd
,
&
rc
);
trace
(
"main window %p: (%ld,%ld)-(%ld,%ld)
\n
"
,
hwnd
,
rc
.
left
,
rc
.
top
,
rc
.
right
,
rc
.
bottom
);
popup
=
CreateWindowExA
(
0
,
"MainWindowClass"
,
NULL
,
WS_POPUP
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
hwnd
,
0
,
0
,
NULL
);
assert
(
popup
!=
0
);
ShowWindow
(
popup
,
SW_SHOW
);
UpdateWindow
(
popup
);
GetWindowRect
(
popup
,
&
rc
);
trace
(
"popup window %p: (%ld,%ld)-(%ld,%ld)
\n
"
,
popup
,
rc
.
left
,
rc
.
top
,
rc
.
right
,
rc
.
bottom
);
x
=
rc
.
left
+
(
rc
.
right
-
rc
.
left
)
/
2
;
y
=
rc
.
top
+
(
rc
.
bottom
-
rc
.
top
)
/
2
;
trace
(
"setting cursor to (%d,%d)
\n
"
,
x
,
y
);
SetCursorPos
(
x
,
y
);
GetCursorPos
(
&
pt
);
ok
(
x
==
pt
.
x
&&
y
==
pt
.
y
,
"wrong cursor pos (%ld,%ld), expected (%d,%d)
\n
"
,
pt
.
x
,
pt
.
y
,
x
,
y
);
/* force the system to update its internal queue mouse position,
* otherwise it won't generate relative mouse movements below.
*/
mouse_event
(
MOUSEEVENTF_MOVE
,
-
1
,
-
1
,
0
,
0
);
while
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessageA
(
&
msg
);
msg
.
message
=
0
;
mouse_event
(
MOUSEEVENTF_MOVE
,
1
,
1
,
0
,
0
);
ok
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"no message available
\n
"
);
ok
(
msg
.
hwnd
==
popup
&&
msg
.
message
==
WM_MOUSEMOVE
,
"hwnd %p message %04x
\n
"
,
msg
.
hwnd
,
msg
.
message
);
/* FIXME: SetCursorPos in Wine generates additional WM_MOUSEMOVE message */
if
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
ok
(
msg
.
hwnd
==
popup
&&
msg
.
message
==
WM_MOUSEMOVE
,
"hwnd %p message %04x
\n
"
,
msg
.
hwnd
,
msg
.
message
);
ok
(
!
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"message %04x available
\n
"
,
msg
.
message
);
mouse_event
(
MOUSEEVENTF_MOVE
,
-
1
,
-
1
,
0
,
0
);
ShowWindow
(
popup
,
SW_HIDE
);
ok
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"no message available
\n
"
);
ok
(
msg
.
hwnd
==
hwnd
&&
msg
.
message
==
WM_MOUSEMOVE
,
"hwnd %p message %04x
\n
"
,
msg
.
hwnd
,
msg
.
message
);
while
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessageA
(
&
msg
);
mouse_event
(
MOUSEEVENTF_MOVE
,
1
,
1
,
0
,
0
);
ShowWindow
(
hwnd
,
SW_HIDE
);
ok
(
!
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"message %04x available
\n
"
,
msg
.
message
);
DestroyWindow
(
popup
);
}
START_TEST
(
win
)
{
pGetAncestor
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"user32.dll"
),
"GetAncestor"
);
...
...
@@ -2153,6 +2213,7 @@ START_TEST(win)
test_children_zorder
(
hwndMain
);
test_keyboard_input
(
hwndMain
);
test_mouse_input
(
hwndMain
);
UnhookWindowsHookEx
(
hhook
);
}
dlls/x11drv/mouse.c
View file @
99fda0a1
...
...
@@ -605,6 +605,8 @@ void X11DRV_MotionNotify( HWND hwnd, XMotionEvent *event )
{
POINT
pt
;
TRACE
(
"hwnd %p, event->is_hint %d
\n
"
,
hwnd
,
event
->
is_hint
);
if
(
!
hwnd
)
return
;
update_cursor
(
hwnd
,
event
->
window
);
...
...
@@ -622,8 +624,10 @@ void X11DRV_EnterNotify( HWND hwnd, XCrossingEvent *event )
{
POINT
pt
;
if
(
event
->
detail
==
NotifyVirtual
||
event
->
detail
==
NotifyNonlinearVirtual
)
return
;
TRACE
(
"hwnd %p, event->detail %d
\n
"
,
hwnd
,
event
->
detail
);
if
(
!
hwnd
)
return
;
if
(
event
->
detail
==
NotifyVirtual
||
event
->
detail
==
NotifyNonlinearVirtual
)
return
;
/* simulate a mouse motion event */
update_cursor
(
hwnd
,
event
->
window
);
...
...
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