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
6576703f
Commit
6576703f
authored
Mar 31, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Return the time of last change along with the current cursor position.
parent
c64c36f5
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
19 deletions
+19
-19
input.c
dlls/user32/input.c
+7
-16
server_protocol.h
include/wine/server_protocol.h
+3
-1
protocol.def
server/protocol.def
+1
-0
queue.c
server/queue.c
+4
-1
request.h
server/request.h
+2
-1
trace.c
server/trace.c
+1
-0
user.h
server/user.h
+1
-0
No files found.
dlls/user32/input.c
View file @
6576703f
...
...
@@ -52,7 +52,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
win
);
WINE_DECLARE_DEBUG_CHANNEL
(
keyboard
);
static
DWORD
last_mouse_event
;
/***********************************************************************
* get_key_state
...
...
@@ -124,10 +123,7 @@ BOOL set_capture_window( HWND hwnd, UINT gui_flags, HWND *prev_ret )
*/
BOOL
CDECL
__wine_send_input
(
HWND
hwnd
,
const
INPUT
*
input
)
{
NTSTATUS
status
;
if
(
input
->
type
==
INPUT_MOUSE
)
last_mouse_event
=
GetTickCount
();
status
=
send_hardware_message
(
hwnd
,
input
,
0
);
NTSTATUS
status
=
send_hardware_message
(
hwnd
,
input
,
0
);
if
(
status
)
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
!
status
;
}
...
...
@@ -183,7 +179,6 @@ UINT WINAPI SendInput( UINT count, LPINPUT inputs, int size )
{
/* we need to update the coordinates to what the server expects */
INPUT
input
=
inputs
[
i
];
last_mouse_event
=
GetTickCount
();
update_mouse_coords
(
&
input
);
if
(
!
(
status
=
send_hardware_message
(
0
,
&
input
,
SEND_HWMSG_INJECTED
)))
{
...
...
@@ -254,28 +249,24 @@ void WINAPI mouse_event( DWORD dwFlags, DWORD dx, DWORD dy,
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
GetCursorPos
(
POINT
*
pt
)
{
BOOL
ret
=
FALSE
;
BOOL
ret
;
DWORD
last_change
;
if
(
!
pt
)
return
FALSE
;
/* query new position from graphics driver if we haven't updated recently */
if
(
GetTickCount
()
-
last_mouse_event
>
100
)
ret
=
USER_Driver
->
pGetCursorPos
(
pt
);
SERVER_START_REQ
(
set_cursor
)
{
if
(
ret
)
/* update it */
{
req
->
flags
=
SET_CURSOR_POS
;
req
->
x
=
pt
->
x
;
req
->
y
=
pt
->
y
;
}
if
((
ret
=
!
wine_server_call
(
req
)))
{
pt
->
x
=
reply
->
new_x
;
pt
->
y
=
reply
->
new_y
;
last_change
=
reply
->
last_change
;
}
}
SERVER_END_REQ
;
/* query new position from graphics driver if we haven't updated recently */
if
(
ret
&&
GetTickCount
()
-
last_change
>
100
)
ret
=
USER_Driver
->
pGetCursorPos
(
pt
);
return
ret
;
}
...
...
include/wine/server_protocol.h
View file @
6576703f
...
...
@@ -4807,6 +4807,8 @@ struct set_cursor_reply
int
new_x
;
int
new_y
;
rectangle_t
new_clip
;
unsigned
int
last_change
;
char
__pad_44
[
4
];
};
#define SET_CURSOR_HANDLE 0x01
#define SET_CURSOR_COUNT 0x02
...
...
@@ -5559,6 +5561,6 @@ union generic_reply
struct
set_cursor_reply
set_cursor_reply
;
};
#define SERVER_PROTOCOL_VERSION 41
7
#define SERVER_PROTOCOL_VERSION 41
8
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/protocol.def
View file @
6576703f
...
...
@@ -3324,6 +3324,7 @@ enum coords_relative
int new_x; /* new position */
int new_y;
rectangle_t new_clip; /* new clip rectangle */
unsigned int last_change; /* time of last position change */
@END
#define SET_CURSOR_HANDLE 0x01
#define SET_CURSOR_COUNT 0x02
...
...
server/queue.c
View file @
6576703f
...
...
@@ -1281,6 +1281,7 @@ static void set_cursor_pos( struct desktop *desktop, int x, int y )
{
desktop
->
cursor
.
x
=
min
(
max
(
x
,
desktop
->
cursor
.
clip
.
left
),
desktop
->
cursor
.
clip
.
right
-
1
);
desktop
->
cursor
.
y
=
min
(
max
(
y
,
desktop
->
cursor
.
clip
.
top
),
desktop
->
cursor
.
clip
.
bottom
-
1
);
desktop
->
cursor
.
last_change
=
get_tick_count
();
}
/* queue a hardware message into a given thread input */
...
...
@@ -1411,9 +1412,10 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
WM_MOUSEHWHEEL
/* 0x1000 = MOUSEEVENTF_HWHEEL */
};
desktop
->
cursor
.
last_change
=
get_tick_count
();
flags
=
input
->
mouse
.
flags
;
time
=
input
->
mouse
.
time
;
if
(
!
time
)
time
=
get_tick_count
()
;
if
(
!
time
)
time
=
desktop
->
cursor
.
last_change
;
if
(
flags
&
MOUSEEVENTF_MOVE
)
{
...
...
@@ -2627,4 +2629,5 @@ DECL_HANDLER(set_cursor)
reply
->
new_x
=
input
->
desktop
->
cursor
.
x
;
reply
->
new_y
=
input
->
desktop
->
cursor
.
y
;
reply
->
new_clip
=
input
->
desktop
->
cursor
.
clip
;
reply
->
last_change
=
input
->
desktop
->
cursor
.
last_change
;
}
server/request.h
View file @
6576703f
...
...
@@ -2103,7 +2103,8 @@ C_ASSERT( FIELD_OFFSET(struct set_cursor_reply, prev_count) == 12 );
C_ASSERT
(
FIELD_OFFSET
(
struct
set_cursor_reply
,
new_x
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_cursor_reply
,
new_y
)
==
20
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_cursor_reply
,
new_clip
)
==
24
);
C_ASSERT
(
sizeof
(
struct
set_cursor_reply
)
==
40
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_cursor_reply
,
last_change
)
==
40
);
C_ASSERT
(
sizeof
(
struct
set_cursor_reply
)
==
48
);
#endif
/* WANT_REQUEST_HANDLERS */
...
...
server/trace.c
View file @
6576703f
...
...
@@ -3905,6 +3905,7 @@ static void dump_set_cursor_reply( const struct set_cursor_reply *req )
fprintf
(
stderr
,
", new_x=%d"
,
req
->
new_x
);
fprintf
(
stderr
,
", new_y=%d"
,
req
->
new_y
);
dump_rectangle
(
", new_clip="
,
&
req
->
new_clip
);
fprintf
(
stderr
,
", last_change=%08x"
,
req
->
last_change
);
}
static
const
dump_func
req_dumpers
[
REQ_NB_REQUESTS
]
=
{
...
...
server/user.h
View file @
6576703f
...
...
@@ -56,6 +56,7 @@ struct global_cursor
int
x
;
/* cursor position */
int
y
;
rectangle_t
clip
;
/* cursor clip rectangle */
unsigned
int
last_change
;
/* time of last position change */
};
struct
desktop
...
...
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