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
16ba0255
Commit
16ba0255
authored
Mar 07, 2005
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Mar 07, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Call SetCursorPos for an injected mouse message only if we really
need to move mouse pointer. - Add a test case for mouse click handling.
parent
9772d022
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
3 deletions
+55
-3
win.c
dlls/user/tests/win.c
+53
-1
input.c
windows/input.c
+2
-2
No files found.
dlls/user/tests/win.c
View file @
16ba0255
...
@@ -48,6 +48,7 @@
...
@@ -48,6 +48,7 @@
static
HWND
(
WINAPI
*
pGetAncestor
)(
HWND
,
UINT
);
static
HWND
(
WINAPI
*
pGetAncestor
)(
HWND
,
UINT
);
static
BOOL
(
WINAPI
*
pGetWindowInfo
)(
HWND
,
WINDOWINFO
*
);
static
BOOL
(
WINAPI
*
pGetWindowInfo
)(
HWND
,
WINDOWINFO
*
);
static
BOOL
test_lbuttondown_flag
;
static
HWND
hwndMessage
;
static
HWND
hwndMessage
;
static
HWND
hwndMain
,
hwndMain2
;
static
HWND
hwndMain
,
hwndMain2
;
static
HHOOK
hhook
;
static
HHOOK
hhook
;
...
@@ -521,6 +522,10 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR
...
@@ -521,6 +522,10 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR
ok
(
!
got_getminmaxinfo
,
"main: WM_GETMINMAXINFO should NOT have been received before WM_NCCREATE
\n
"
);
ok
(
!
got_getminmaxinfo
,
"main: WM_GETMINMAXINFO should NOT have been received before WM_NCCREATE
\n
"
);
break
;
break
;
}
}
case
WM_COMMAND
:
if
(
test_lbuttondown_flag
)
ShowWindow
((
HWND
)
wparam
,
SW_SHOW
);
break
;
}
}
return
DefWindowProcA
(
hwnd
,
msg
,
wparam
,
lparam
);
return
DefWindowProcA
(
hwnd
,
msg
,
wparam
,
lparam
);
...
@@ -569,7 +574,7 @@ static BOOL RegisterWindowClasses(void)
...
@@ -569,7 +574,7 @@ static BOOL RegisterWindowClasses(void)
{
{
WNDCLASSA
cls
;
WNDCLASSA
cls
;
cls
.
style
=
0
;
cls
.
style
=
CS_DBLCLKS
;
cls
.
lpfnWndProc
=
main_window_procA
;
cls
.
lpfnWndProc
=
main_window_procA
;
cls
.
cbClsExtra
=
0
;
cls
.
cbClsExtra
=
0
;
cls
.
cbWndExtra
=
0
;
cls
.
cbWndExtra
=
0
;
...
@@ -2241,6 +2246,53 @@ static void test_mouse_input(HWND hwnd)
...
@@ -2241,6 +2246,53 @@ static void test_mouse_input(HWND hwnd)
ret
=
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
);
ret
=
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
);
ok
(
!
ret
,
"message %04x available
\n
"
,
msg
.
message
);
ok
(
!
ret
,
"message %04x available
\n
"
,
msg
.
message
);
/* test mouse clicks */
ShowWindow
(
hwnd
,
SW_SHOW
);
ShowWindow
(
popup
,
SW_SHOW
);
while
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessageA
(
&
msg
);
mouse_event
(
MOUSEEVENTF_LEFTDOWN
,
0
,
0
,
0
,
0
);
mouse_event
(
MOUSEEVENTF_LEFTUP
,
0
,
0
,
0
,
0
);
mouse_event
(
MOUSEEVENTF_LEFTDOWN
,
0
,
0
,
0
,
0
);
mouse_event
(
MOUSEEVENTF_LEFTUP
,
0
,
0
,
0
,
0
);
ok
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"no message available
\n
"
);
ok
(
msg
.
hwnd
==
popup
&&
msg
.
message
==
WM_LBUTTONDOWN
,
"hwnd %p message %04x
\n
"
,
msg
.
hwnd
,
msg
.
message
);
ok
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"no message available
\n
"
);
ok
(
msg
.
hwnd
==
popup
&&
msg
.
message
==
WM_LBUTTONUP
,
"hwnd %p message %04x
\n
"
,
msg
.
hwnd
,
msg
.
message
);
ok
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"no message available
\n
"
);
ok
(
msg
.
hwnd
==
popup
&&
msg
.
message
==
WM_LBUTTONDBLCLK
,
"hwnd %p message %04x
\n
"
,
msg
.
hwnd
,
msg
.
message
);
ok
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"no message available
\n
"
);
ok
(
msg
.
hwnd
==
popup
&&
msg
.
message
==
WM_LBUTTONUP
,
"hwnd %p message %04x
\n
"
,
msg
.
hwnd
,
msg
.
message
);
ret
=
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
);
ok
(
!
ret
,
"message %04x available
\n
"
,
msg
.
message
);
ShowWindow
(
popup
,
SW_HIDE
);
while
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessageA
(
&
msg
);
mouse_event
(
MOUSEEVENTF_LEFTDOWN
,
0
,
0
,
0
,
0
);
mouse_event
(
MOUSEEVENTF_LEFTUP
,
0
,
0
,
0
,
0
);
mouse_event
(
MOUSEEVENTF_LEFTDOWN
,
0
,
0
,
0
,
0
);
mouse_event
(
MOUSEEVENTF_LEFTUP
,
0
,
0
,
0
,
0
);
ok
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"no message available
\n
"
);
ok
(
msg
.
hwnd
==
hwnd
&&
msg
.
message
==
WM_LBUTTONDOWN
,
"hwnd %p message %04x
\n
"
,
msg
.
hwnd
,
msg
.
message
);
ok
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"no message available
\n
"
);
ok
(
msg
.
hwnd
==
hwnd
&&
msg
.
message
==
WM_LBUTTONUP
,
"hwnd %p message %04x
\n
"
,
msg
.
hwnd
,
msg
.
message
);
test_lbuttondown_flag
=
TRUE
;
SendMessageA
(
hwnd
,
WM_COMMAND
,
(
WPARAM
)
popup
,
0
);
test_lbuttondown_flag
=
FALSE
;
ok
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"no message available
\n
"
);
ok
(
msg
.
hwnd
==
popup
&&
msg
.
message
==
WM_LBUTTONDOWN
,
"hwnd %p message %04x
\n
"
,
msg
.
hwnd
,
msg
.
message
);
ok
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"no message available
\n
"
);
ok
(
msg
.
hwnd
==
popup
&&
msg
.
message
==
WM_LBUTTONUP
,
"hwnd %p message %04x
\n
"
,
msg
.
hwnd
,
msg
.
message
);
ok
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"no message available
\n
"
);
DestroyWindow
(
popup
);
DestroyWindow
(
popup
);
}
}
...
...
windows/input.c
View file @
16ba0255
...
@@ -285,6 +285,8 @@ static void queue_mouse_event( const MOUSEINPUT *mi, UINT flags )
...
@@ -285,6 +285,8 @@ static void queue_mouse_event( const MOUSEINPUT *mi, UINT flags )
if
(
mi
->
dwFlags
&
MOUSEEVENTF_MOVE
)
if
(
mi
->
dwFlags
&
MOUSEEVENTF_MOVE
)
{
{
queue_raw_mouse_message
(
WM_MOUSEMOVE
,
flags
,
PosX
,
PosY
,
mi
);
queue_raw_mouse_message
(
WM_MOUSEMOVE
,
flags
,
PosX
,
PosY
,
mi
);
if
(
flags
&
LLMHF_INJECTED
)
/* we have to actually move the cursor */
SetCursorPos
(
PosX
,
PosY
);
}
}
if
(
mi
->
dwFlags
&
MOUSEEVENTF_LEFTDOWN
)
if
(
mi
->
dwFlags
&
MOUSEEVENTF_LEFTDOWN
)
{
{
...
@@ -327,8 +329,6 @@ static void queue_mouse_event( const MOUSEINPUT *mi, UINT flags )
...
@@ -327,8 +329,6 @@ static void queue_mouse_event( const MOUSEINPUT *mi, UINT flags )
{
{
queue_raw_mouse_message
(
WM_MOUSEWHEEL
,
flags
,
PosX
,
PosY
,
mi
);
queue_raw_mouse_message
(
WM_MOUSEWHEEL
,
flags
,
PosX
,
PosY
,
mi
);
}
}
if
(
flags
&
LLMHF_INJECTED
)
/* we have to actually move the cursor */
SetCursorPos
(
PosX
,
PosY
);
}
}
...
...
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