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
7de64a3a
Commit
7de64a3a
authored
Dec 18, 2006
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Dec 19, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11drv: Return cached cursor_pos in GetCursorPos().
parent
84f0a035
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
win.c
dlls/user32/tests/win.c
+9
-0
mouse.c
dlls/winex11.drv/mouse.c
+12
-1
No files found.
dlls/user32/tests/win.c
View file @
7de64a3a
...
...
@@ -2501,6 +2501,15 @@ static void test_mouse_input(HWND hwnd)
GetCursorPos
(
&
pt
);
ok
(
x
==
pt
.
x
&&
y
==
pt
.
y
,
"wrong cursor pos (%d,%d), expected (%d,%d)
\n
"
,
pt
.
x
,
pt
.
y
,
x
,
y
);
while
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessageA
(
&
msg
);
/* Check that setting the same position will generate WM_MOUSEMOVE */
SetCursorPos
(
x
,
y
);
msg
.
message
=
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
);
ok
(
msg
.
pt
.
x
==
x
&&
msg
.
pt
.
y
==
y
,
"wrong message coords (%d,%d)/(%d,%d)
\n
"
,
x
,
y
,
msg
.
pt
.
x
,
msg
.
pt
.
y
);
/* force the system to update its internal queue mouse position,
* otherwise it won't generate relative mouse movements below.
*/
...
...
dlls/winex11.drv/mouse.c
View file @
7de64a3a
...
...
@@ -70,6 +70,7 @@ static const UINT button_up_flags[NB_BUTTONS] =
};
POINT
cursor_pos
;
static
DWORD
last_time_modified
;
BOOL
X11DRV_SetCursorPos
(
INT
x
,
INT
y
);
...
...
@@ -190,6 +191,7 @@ static void queue_raw_mouse_message( UINT message, HWND hwnd, DWORD x, DWORD y,
hook
.
time
=
time
;
hook
.
dwExtraInfo
=
extra_info
;
last_time_modified
=
GetTickCount
();
if
(
HOOK_CallHooks
(
WH_MOUSE_LL
,
HC_ACTION
,
message
,
(
LPARAM
)
&
hook
,
TRUE
))
return
;
SERVER_START_REQ
(
send_hardware_message
)
...
...
@@ -685,6 +687,14 @@ BOOL X11DRV_SetCursorPos( INT x, INT y )
TRACE
(
"warping to (%d,%d)
\n
"
,
x
,
y
);
wine_tsx11_lock
();
if
(
cursor_pos
.
x
==
x
&&
cursor_pos
.
y
==
y
)
{
wine_tsx11_unlock
();
/* We still need to generate WM_MOUSEMOVE */
queue_raw_mouse_message
(
WM_MOUSEMOVE
,
NULL
,
x
,
y
,
0
,
GetCurrentTime
(),
0
,
0
);
return
TRUE
;
}
XWarpPointer
(
display
,
root_window
,
root_window
,
0
,
0
,
0
,
0
,
x
-
virtual_screen_rect
.
left
,
y
-
virtual_screen_rect
.
top
);
XFlush
(
display
);
/* avoids bad mouse lag in games that do their own mouse warping */
...
...
@@ -705,7 +715,8 @@ BOOL X11DRV_GetCursorPos(LPPOINT pos)
unsigned
int
xstate
;
wine_tsx11_lock
();
if
(
XQueryPointer
(
display
,
root_window
,
&
root
,
&
child
,
if
((
GetTickCount
()
-
last_time_modified
>
100
)
&&
XQueryPointer
(
display
,
root_window
,
&
root
,
&
child
,
&
rootX
,
&
rootY
,
&
winX
,
&
winY
,
&
xstate
))
{
update_button_state
(
xstate
);
...
...
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