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
183c41b4
Commit
183c41b4
authored
Feb 24, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Store the global cursor position in the server.
parent
ac4aac74
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
64 additions
and
11 deletions
+64
-11
input.c
dlls/user32/input.c
+16
-1
server_protocol.h
include/wine/server_protocol.h
+6
-1
protocol.def
server/protocol.def
+5
-0
queue.c
server/queue.c
+23
-7
request.h
server/request.h
+6
-2
trace.c
server/trace.c
+4
-0
user.h
server/user.h
+2
-0
winstation.c
server/winstation.c
+2
-0
No files found.
dlls/user32/input.c
View file @
183c41b4
...
...
@@ -231,7 +231,22 @@ BOOL WINAPI GetCursorInfo( PCURSORINFO pci )
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
SetCursorPos
(
INT
x
,
INT
y
)
{
return
USER_Driver
->
pSetCursorPos
(
x
,
y
);
BOOL
ret
;
SERVER_START_REQ
(
set_cursor
)
{
req
->
flags
=
SET_CURSOR_POS
;
req
->
x
=
x
;
req
->
y
=
y
;
if
((
ret
=
!
wine_server_call
(
req
)))
{
x
=
reply
->
new_x
;
y
=
reply
->
new_y
;
}
}
SERVER_END_REQ
;
if
(
ret
)
ret
=
USER_Driver
->
pSetCursorPos
(
x
,
y
);
return
ret
;
}
...
...
include/wine/server_protocol.h
View file @
183c41b4
...
...
@@ -4769,15 +4769,20 @@ struct set_cursor_request
unsigned
int
flags
;
user_handle_t
handle
;
int
show_count
;
int
x
;
int
y
;
};
struct
set_cursor_reply
{
struct
reply_header
__header
;
user_handle_t
prev_handle
;
int
prev_count
;
int
new_x
;
int
new_y
;
};
#define SET_CURSOR_HANDLE 0x01
#define SET_CURSOR_COUNT 0x02
#define SET_CURSOR_POS 0x04
enum
request
...
...
@@ -5525,6 +5530,6 @@ union generic_reply
struct
set_cursor_reply
set_cursor_reply
;
};
#define SERVER_PROTOCOL_VERSION 41
2
#define SERVER_PROTOCOL_VERSION 41
3
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/protocol.def
View file @
183c41b4
...
...
@@ -3290,9 +3290,14 @@ enum coords_relative
unsigned int flags; /* flags for fields to set (see below) */
user_handle_t handle; /* handle to the cursor */
int show_count; /* show count increment/decrement */
int x; /* cursor position */
int y;
@REPLY
user_handle_t prev_handle; /* previous handle */
int prev_count; /* previous show count */
int new_x; /* new position */
int new_y;
@END
#define SET_CURSOR_HANDLE 0x01
#define SET_CURSOR_COUNT 0x02
#define SET_CURSOR_POS 0x04
server/queue.c
View file @
183c41b4
...
...
@@ -1237,8 +1237,9 @@ static void release_hardware_message( struct msg_queue *queue, unsigned int hw_i
/* find the window that should receive a given hardware message */
static
user_handle_t
find_hardware_message_window
(
struct
thread_input
*
input
,
struct
message
*
msg
,
struct
hardware_msg_data
*
data
,
unsigned
int
*
msg_code
)
unsigned
int
*
msg_code
)
{
struct
hardware_msg_data
*
data
=
msg
->
data
;
user_handle_t
win
=
0
;
*
msg_code
=
msg
->
msg
;
...
...
@@ -1264,15 +1265,23 @@ static user_handle_t find_hardware_message_window( struct thread_input *input, s
}
/* queue a hardware message into a given thread input */
static
void
queue_hardware_message
(
struct
thread_input
*
input
,
struct
message
*
msg
,
struct
hardware_msg_data
*
data
)
static
void
queue_hardware_message
(
struct
desktop
*
desktop
,
struct
thread_input
*
input
,
struct
message
*
msg
)
{
user_handle_t
win
;
struct
thread
*
thread
;
unsigned
int
msg_code
;
struct
hardware_msg_data
*
data
=
msg
->
data
;
if
(
msg
->
msg
==
WM_MOUSEMOVE
)
{
desktop
->
cursor_x
=
data
->
x
;
desktop
->
cursor_y
=
data
->
y
;
}
data
->
x
=
desktop
->
cursor_x
;
data
->
y
=
desktop
->
cursor_y
;
last_input_time
=
get_tick_count
();
win
=
find_hardware_message_window
(
input
,
msg
,
data
,
&
msg_code
);
win
=
find_hardware_message_window
(
input
,
msg
,
&
msg_code
);
if
(
!
win
||
!
(
thread
=
get_window_thread
(
win
)))
{
if
(
input
)
update_input_key_state
(
input
,
msg
);
...
...
@@ -1361,7 +1370,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user
struct
hardware_msg_data
*
data
=
msg
->
data
;
ptr
=
list_next
(
&
input
->
msg_list
,
ptr
);
win
=
find_hardware_message_window
(
input
,
msg
,
data
,
&
msg_code
);
win
=
find_hardware_message_window
(
input
,
msg
,
&
msg_code
);
if
(
!
win
||
!
(
win_thread
=
get_window_thread
(
win
)))
{
/* no window at all, remove it */
...
...
@@ -1748,7 +1757,7 @@ DECL_HANDLER(send_hardware_message)
msg
->
result
=
NULL
;
msg
->
data
=
data
;
msg
->
data_size
=
sizeof
(
*
data
);
queue_hardware_message
(
input
,
msg
,
data
);
queue_hardware_message
(
desktop
,
input
,
msg
);
}
else
free
(
data
);
...
...
@@ -2286,10 +2295,17 @@ DECL_HANDLER(set_cursor)
}
input
->
cursor
=
req
->
handle
;
}
if
(
req
->
flags
&
SET_CURSOR_COUNT
)
{
queue
->
cursor_count
+=
req
->
show_count
;
input
->
cursor_count
+=
req
->
show_count
;
}
if
(
req
->
flags
&
SET_CURSOR_POS
)
{
input
->
desktop
->
cursor_x
=
req
->
x
;
input
->
desktop
->
cursor_y
=
req
->
y
;
}
reply
->
new_x
=
input
->
desktop
->
cursor_x
;
reply
->
new_y
=
input
->
desktop
->
cursor_y
;
}
server/request.h
View file @
183c41b4
...
...
@@ -2100,10 +2100,14 @@ C_ASSERT( sizeof(struct free_user_handle_request) == 16 );
C_ASSERT
(
FIELD_OFFSET
(
struct
set_cursor_request
,
flags
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_cursor_request
,
handle
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_cursor_request
,
show_count
)
==
20
);
C_ASSERT
(
sizeof
(
struct
set_cursor_request
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_cursor_request
,
x
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_cursor_request
,
y
)
==
28
);
C_ASSERT
(
sizeof
(
struct
set_cursor_request
)
==
32
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_cursor_reply
,
prev_handle
)
==
8
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_cursor_reply
,
prev_count
)
==
12
);
C_ASSERT
(
sizeof
(
struct
set_cursor_reply
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_cursor_reply
,
new_x
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_cursor_reply
,
new_y
)
==
20
);
C_ASSERT
(
sizeof
(
struct
set_cursor_reply
)
==
24
);
#endif
/* WANT_REQUEST_HANDLERS */
...
...
server/trace.c
View file @
183c41b4
...
...
@@ -3871,12 +3871,16 @@ static void dump_set_cursor_request( const struct set_cursor_request *req )
fprintf
(
stderr
,
" flags=%08x"
,
req
->
flags
);
fprintf
(
stderr
,
", handle=%08x"
,
req
->
handle
);
fprintf
(
stderr
,
", show_count=%d"
,
req
->
show_count
);
fprintf
(
stderr
,
", x=%d"
,
req
->
x
);
fprintf
(
stderr
,
", y=%d"
,
req
->
y
);
}
static
void
dump_set_cursor_reply
(
const
struct
set_cursor_reply
*
req
)
{
fprintf
(
stderr
,
" prev_handle=%08x"
,
req
->
prev_handle
);
fprintf
(
stderr
,
", prev_count=%d"
,
req
->
prev_count
);
fprintf
(
stderr
,
", new_x=%d"
,
req
->
new_x
);
fprintf
(
stderr
,
", new_y=%d"
,
req
->
new_y
);
}
static
const
dump_func
req_dumpers
[
REQ_NB_REQUESTS
]
=
{
...
...
server/user.h
View file @
183c41b4
...
...
@@ -63,6 +63,8 @@ struct desktop
struct
timeout_user
*
close_timeout
;
/* timeout before closing the desktop */
struct
thread_input
*
foreground_input
;
/* thread input of foreground thread */
unsigned
int
users
;
/* processes and threads using this desktop */
int
cursor_x
;
/* cursor position */
int
cursor_y
;
};
/* user handles functions */
...
...
server/winstation.c
View file @
183c41b4
...
...
@@ -232,6 +232,8 @@ static struct desktop *create_desktop( const struct unicode_str *name, unsigned
desktop
->
close_timeout
=
NULL
;
desktop
->
foreground_input
=
NULL
;
desktop
->
users
=
0
;
desktop
->
cursor_x
=
0
;
desktop
->
cursor_y
=
0
;
list_add_tail
(
&
winstation
->
desktops
,
&
desktop
->
entry
);
}
}
...
...
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