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
b9e4b5a2
Commit
b9e4b5a2
authored
Feb 28, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Fill the key state in mouse events from the server-side state.
parent
c7089361
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
44 deletions
+16
-44
mouse.c
dlls/winex11.drv/mouse.c
+1
-41
queue.c
server/queue.c
+15
-3
No files found.
dlls/winex11.drv/mouse.c
View file @
b9e4b5a2
...
...
@@ -145,19 +145,6 @@ static inline void clip_point_to_rect( LPCRECT rect, LPPOINT pt )
}
/***********************************************************************
* update_button_state
*
* Update the button state with what X provides us
*/
static
inline
void
update_button_state
(
unsigned
int
state
)
{
key_state_table
[
VK_LBUTTON
]
=
(
state
&
Button1Mask
?
0x80
:
0
);
key_state_table
[
VK_MBUTTON
]
=
(
state
&
Button2Mask
?
0x80
:
0
);
key_state_table
[
VK_RBUTTON
]
=
(
state
&
Button3Mask
?
0x80
:
0
);
/* X-buttons are not reported from XQueryPointer */
}
/***********************************************************************
* get_empty_cursor
*/
static
Cursor
get_empty_cursor
(
void
)
...
...
@@ -299,32 +286,6 @@ static HWND update_mouse_state( HWND hwnd, Window window, int x, int y, unsigned
/***********************************************************************
* get_key_state
*/
static
WORD
get_key_state
(
void
)
{
WORD
ret
=
0
;
if
(
GetSystemMetrics
(
SM_SWAPBUTTON
))
{
if
(
key_state_table
[
VK_RBUTTON
]
&
0x80
)
ret
|=
MK_LBUTTON
;
if
(
key_state_table
[
VK_LBUTTON
]
&
0x80
)
ret
|=
MK_RBUTTON
;
}
else
{
if
(
key_state_table
[
VK_LBUTTON
]
&
0x80
)
ret
|=
MK_LBUTTON
;
if
(
key_state_table
[
VK_RBUTTON
]
&
0x80
)
ret
|=
MK_RBUTTON
;
}
if
(
key_state_table
[
VK_MBUTTON
]
&
0x80
)
ret
|=
MK_MBUTTON
;
if
(
key_state_table
[
VK_SHIFT
]
&
0x80
)
ret
|=
MK_SHIFT
;
if
(
key_state_table
[
VK_CONTROL
]
&
0x80
)
ret
|=
MK_CONTROL
;
if
(
key_state_table
[
VK_XBUTTON1
]
&
0x80
)
ret
|=
MK_XBUTTON1
;
if
(
key_state_table
[
VK_XBUTTON2
]
&
0x80
)
ret
|=
MK_XBUTTON2
;
return
ret
;
}
/***********************************************************************
* queue_raw_mouse_message
*/
static
void
queue_raw_mouse_message
(
UINT
message
,
HWND
hwnd
,
DWORD
x
,
DWORD
y
,
...
...
@@ -348,7 +309,7 @@ static void queue_raw_mouse_message( UINT message, HWND hwnd, DWORD x, DWORD y,
req
->
id
=
(
injected_flags
&
LLMHF_INJECTED
)
?
0
:
GetCurrentThreadId
();
req
->
win
=
wine_server_user_handle
(
hwnd
);
req
->
msg
=
message
;
req
->
wparam
=
MAKEWPARAM
(
get_key_state
()
,
data
);
req
->
wparam
=
MAKEWPARAM
(
0
,
data
);
req
->
lparam
=
0
;
req
->
x
=
x
;
req
->
y
=
y
;
...
...
@@ -1113,7 +1074,6 @@ BOOL CDECL X11DRV_GetCursorPos(LPPOINT pos)
XQueryPointer
(
display
,
root_window
,
&
root
,
&
child
,
&
rootX
,
&
rootY
,
&
winX
,
&
winY
,
&
xstate
))
{
update_button_state
(
xstate
);
winX
+=
virtual_screen_rect
.
left
;
winY
+=
virtual_screen_rect
.
top
;
TRACE
(
"pointer at (%d,%d)
\n
"
,
winX
,
winY
);
...
...
server/queue.c
View file @
b9e4b5a2
...
...
@@ -1280,11 +1280,23 @@ static void queue_hardware_message( struct desktop *desktop, struct thread_input
unsigned
int
msg_code
;
struct
hardware_msg_data
*
data
=
msg
->
data
;
if
(
msg
->
msg
==
WM_MOUSEMOVE
)
set_cursor_pos
(
desktop
,
data
->
x
,
data
->
y
);
data
->
x
=
desktop
->
cursor_x
;
data
->
y
=
desktop
->
cursor_y
;
update_input_key_state
(
desktop
->
keystate
,
msg
);
last_input_time
=
get_tick_count
();
if
(
!
is_keyboard_msg
(
msg
))
{
if
(
msg
->
msg
==
WM_MOUSEMOVE
)
set_cursor_pos
(
desktop
,
data
->
x
,
data
->
y
);
if
(
desktop
->
keystate
[
VK_LBUTTON
]
&
0x80
)
msg
->
wparam
|=
MK_LBUTTON
;
if
(
desktop
->
keystate
[
VK_MBUTTON
]
&
0x80
)
msg
->
wparam
|=
MK_MBUTTON
;
if
(
desktop
->
keystate
[
VK_RBUTTON
]
&
0x80
)
msg
->
wparam
|=
MK_RBUTTON
;
if
(
desktop
->
keystate
[
VK_SHIFT
]
&
0x80
)
msg
->
wparam
|=
MK_SHIFT
;
if
(
desktop
->
keystate
[
VK_CONTROL
]
&
0x80
)
msg
->
wparam
|=
MK_CONTROL
;
if
(
desktop
->
keystate
[
VK_XBUTTON1
]
&
0x80
)
msg
->
wparam
|=
MK_XBUTTON1
;
if
(
desktop
->
keystate
[
VK_XBUTTON2
]
&
0x80
)
msg
->
wparam
|=
MK_XBUTTON2
;
}
data
->
x
=
desktop
->
cursor_x
;
data
->
y
=
desktop
->
cursor_y
;
win
=
find_hardware_message_window
(
input
,
msg
,
&
msg_code
);
if
(
!
win
||
!
(
thread
=
get_window_thread
(
win
)))
{
...
...
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