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
7b9fd801
Commit
7b9fd801
authored
May 20, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
May 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Directly use win32u for user functions in mouse.c.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
parent
169a09b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
9 deletions
+38
-9
macdrv.h
dlls/winemac.drv/macdrv.h
+7
-0
mouse.c
dlls/winemac.drv/mouse.c
+31
-9
No files found.
dlls/winemac.drv/macdrv.h
View file @
7b9fd801
...
@@ -309,6 +309,13 @@ static inline HWND get_active_window(void)
...
@@ -309,6 +309,13 @@ static inline HWND get_active_window(void)
return
NtUserGetGUIThreadInfo
(
GetCurrentThreadId
(),
&
info
)
?
info
.
hwndActive
:
0
;
return
NtUserGetGUIThreadInfo
(
GetCurrentThreadId
(),
&
info
)
?
info
.
hwndActive
:
0
;
}
}
static
inline
HWND
get_capture
(
void
)
{
GUITHREADINFO
info
;
info
.
cbSize
=
sizeof
(
info
);
return
NtUserGetGUIThreadInfo
(
GetCurrentThreadId
(),
&
info
)
?
info
.
hwndCapture
:
0
;
}
/* registry helpers */
/* registry helpers */
extern
HKEY
open_hkcu_key
(
const
char
*
name
)
DECLSPEC_HIDDEN
;
extern
HKEY
open_hkcu_key
(
const
char
*
name
)
DECLSPEC_HIDDEN
;
...
...
dlls/winemac.drv/mouse.c
View file @
7b9fd801
...
@@ -131,7 +131,7 @@ static void send_mouse_input(HWND hwnd, macdrv_window cocoa_window, UINT flags,
...
@@ -131,7 +131,7 @@ static void send_mouse_input(HWND hwnd, macdrv_window cocoa_window, UINT flags,
INPUT
input
;
INPUT
input
;
HWND
top_level_hwnd
;
HWND
top_level_hwnd
;
top_level_hwnd
=
GetAncestor
(
hwnd
,
GA_ROOT
);
top_level_hwnd
=
NtUser
GetAncestor
(
hwnd
,
GA_ROOT
);
if
((
flags
&
MOUSEEVENTF_MOVE
)
&&
(
flags
&
MOUSEEVENTF_ABSOLUTE
)
&&
!
drag
&&
if
((
flags
&
MOUSEEVENTF_MOVE
)
&&
(
flags
&
MOUSEEVENTF_ABSOLUTE
)
&&
!
drag
&&
cocoa_window
!=
macdrv_thread_data
()
->
capture_window
)
cocoa_window
!=
macdrv_thread_data
()
->
capture_window
)
...
@@ -500,7 +500,7 @@ static CFDictionaryRef create_cursor_frame(HDC hdc, const ICONINFOEXW *iinfo, HA
...
@@ -500,7 +500,7 @@ static CFDictionaryRef create_cursor_frame(HDC hdc, const ICONINFOEXW *iinfo, HA
CFDictionarySetValue
(
frame
,
CFSTR
(
"hotSpot"
),
hot_spot_dict
);
CFDictionarySetValue
(
frame
,
CFSTR
(
"hotSpot"
),
hot_spot_dict
);
CFRelease
(
hot_spot_dict
);
CFRelease
(
hot_spot_dict
);
if
(
GetCursorFrameInfo
(
icon
,
0x0
/* unknown parameter */
,
istep
,
&
delay_jiffies
,
&
num_steps
)
!=
0
)
if
(
NtUserGetCursorFrameInfo
(
icon
,
istep
,
&
delay_jiffies
,
&
num_steps
)
!=
0
)
duration
=
delay_jiffies
/
60
.
0
;
/* convert jiffies (1/60s) to seconds */
duration
=
delay_jiffies
/
60
.
0
;
/* convert jiffies (1/60s) to seconds */
else
else
{
{
...
@@ -554,7 +554,7 @@ static CFArrayRef create_color_cursor(HDC hdc, const ICONINFOEXW *iinfo, HANDLE
...
@@ -554,7 +554,7 @@ static CFArrayRef create_color_cursor(HDC hdc, const ICONINFOEXW *iinfo, HANDLE
TRACE
(
"hdc %p iinfo %p icon %p width %d height %d
\n
"
,
hdc
,
iinfo
,
icon
,
width
,
height
);
TRACE
(
"hdc %p iinfo %p icon %p width %d height %d
\n
"
,
hdc
,
iinfo
,
icon
,
width
,
height
);
/* Retrieve the number of frames to render */
/* Retrieve the number of frames to render */
if
(
!
GetCursorFrameInfo
(
icon
,
0x0
/* unknown parameter */
,
0
,
&
delay_jiffies
,
&
nFrames
))
if
(
!
NtUserGetCursorFrameInfo
(
icon
,
0
,
&
delay_jiffies
,
&
nFrames
))
{
{
WARN
(
"GetCursorFrameInfo failed
\n
"
);
WARN
(
"GetCursorFrameInfo failed
\n
"
);
return
NULL
;
return
NULL
;
...
@@ -699,7 +699,7 @@ BOOL macdrv_GetCursorPos(LPPOINT pos)
...
@@ -699,7 +699,7 @@ BOOL macdrv_GetCursorPos(LPPOINT pos)
void
macdrv_SetCapture
(
HWND
hwnd
,
UINT
flags
)
void
macdrv_SetCapture
(
HWND
hwnd
,
UINT
flags
)
{
{
struct
macdrv_thread_data
*
thread_data
=
macdrv_thread_data
();
struct
macdrv_thread_data
*
thread_data
=
macdrv_thread_data
();
HWND
top
=
GetAncestor
(
hwnd
,
GA_ROOT
);
HWND
top
=
NtUser
GetAncestor
(
hwnd
,
GA_ROOT
);
macdrv_window
cocoa_window
=
macdrv_get_cocoa_window
(
top
,
FALSE
);
macdrv_window
cocoa_window
=
macdrv_get_cocoa_window
(
top
,
FALSE
);
TRACE
(
"hwnd %p top %p/%p flags 0x%08x
\n
"
,
hwnd
,
top
,
cocoa_window
,
flags
);
TRACE
(
"hwnd %p top %p/%p flags 0x%08x
\n
"
,
hwnd
,
top
,
cocoa_window
,
flags
);
...
@@ -711,6 +711,28 @@ BOOL macdrv_GetCursorPos(LPPOINT pos)
...
@@ -711,6 +711,28 @@ BOOL macdrv_GetCursorPos(LPPOINT pos)
}
}
static
BOOL
get_icon_info
(
HICON
handle
,
ICONINFOEXW
*
ret
)
{
UNICODE_STRING
module
,
res_name
;
ICONINFO
info
;
module
.
Buffer
=
ret
->
szModName
;
module
.
MaximumLength
=
sizeof
(
ret
->
szModName
)
-
sizeof
(
WCHAR
);
res_name
.
Buffer
=
ret
->
szResName
;
res_name
.
MaximumLength
=
sizeof
(
ret
->
szResName
)
-
sizeof
(
WCHAR
);
if
(
!
NtUserGetIconInfo
(
handle
,
&
info
,
&
module
,
&
res_name
,
NULL
,
0
))
return
FALSE
;
ret
->
fIcon
=
info
.
fIcon
;
ret
->
xHotspot
=
info
.
xHotspot
;
ret
->
yHotspot
=
info
.
yHotspot
;
ret
->
hbmColor
=
info
.
hbmColor
;
ret
->
hbmMask
=
info
.
hbmMask
;
ret
->
wResID
=
res_name
.
Length
?
0
:
LOWORD
(
res_name
.
Buffer
);
ret
->
szModName
[
module
.
Length
]
=
0
;
ret
->
szResName
[
res_name
.
Length
]
=
0
;
return
TRUE
;
}
/***********************************************************************
/***********************************************************************
* SetCursor (MACDRV.@)
* SetCursor (MACDRV.@)
*/
*/
...
@@ -742,7 +764,7 @@ void macdrv_SetCursor(HCURSOR cursor)
...
@@ -742,7 +764,7 @@ void macdrv_SetCursor(HCURSOR cursor)
goto
done
;
goto
done
;
info
.
cbSize
=
sizeof
(
info
);
info
.
cbSize
=
sizeof
(
info
);
if
(
!
GetIconInfoExW
(
cursor
,
&
info
))
if
(
!
get_icon_info
(
cursor
,
&
info
))
{
{
WARN
(
"GetIconInfoExW failed
\n
"
);
WARN
(
"GetIconInfoExW failed
\n
"
);
return
;
return
;
...
@@ -919,16 +941,16 @@ void macdrv_mouse_scroll(HWND hwnd, const macdrv_event *event)
...
@@ -919,16 +941,16 @@ void macdrv_mouse_scroll(HWND hwnd, const macdrv_event *event)
void
macdrv_release_capture
(
HWND
hwnd
,
const
macdrv_event
*
event
)
void
macdrv_release_capture
(
HWND
hwnd
,
const
macdrv_event
*
event
)
{
{
struct
macdrv_thread_data
*
thread_data
=
macdrv_thread_data
();
struct
macdrv_thread_data
*
thread_data
=
macdrv_thread_data
();
HWND
capture
=
GetC
apture
();
HWND
capture
=
get_c
apture
();
HWND
capture_top
=
GetAncestor
(
capture
,
GA_ROOT
);
HWND
capture_top
=
NtUser
GetAncestor
(
capture
,
GA_ROOT
);
TRACE
(
"win %p/%p thread_data->capture_window %p GetCapture() %p in %p
\n
"
,
hwnd
,
TRACE
(
"win %p/%p thread_data->capture_window %p GetCapture() %p in %p
\n
"
,
hwnd
,
event
->
window
,
thread_data
->
capture_window
,
capture
,
capture_top
);
event
->
window
,
thread_data
->
capture_window
,
capture
,
capture_top
);
if
(
event
->
window
==
thread_data
->
capture_window
&&
hwnd
==
capture_top
)
if
(
event
->
window
==
thread_data
->
capture_window
&&
hwnd
==
capture_top
)
{
{
ReleaseCapture
();
NtUser
ReleaseCapture
();
if
(
!
PostMessageW
(
capture
,
WM_CANCELMODE
,
0
,
0
))
if
(
!
NtUserPostMessage
(
capture
,
WM_CANCELMODE
,
0
,
0
))
WARN
(
"failed to post WM_CANCELMODE; error 0x%08x
\n
"
,
GetLastError
());
WARN
(
"failed to post WM_CANCELMODE; error 0x%08x
\n
"
,
GetLastError
());
}
}
}
}
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