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
8534fe2d
Commit
8534fe2d
authored
May 20, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
May 20, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Directly use win32u for GDI functions in mouse.c.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d71abff1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
mouse.c
dlls/winemac.drv/mouse.c
+14
-12
No files found.
dlls/winemac.drv/mouse.c
View file @
8534fe2d
...
...
@@ -290,7 +290,7 @@ CFArrayRef create_monochrome_cursor(HDC hdc, const ICONINFOEXW *icon, int width,
}
xor_bits
=
(
unsigned
long
*
)((
char
*
)
and_bits
+
info
->
bmiHeader
.
biSizeImage
/
2
);
if
(
!
GetDIBits
(
hdc
,
icon
->
hbmMask
,
0
,
height
*
2
,
and_bits
,
info
,
DIB_RGB_COLORS
))
if
(
!
NtGdiGetDIBitsInternal
(
hdc
,
icon
->
hbmMask
,
0
,
height
*
2
,
and_bits
,
info
,
DIB_RGB_COLORS
,
0
,
0
))
{
WARN
(
"GetDIBits failed
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
and_bits
);
...
...
@@ -579,7 +579,8 @@ static CFArrayRef create_color_cursor(HDC hdc, const ICONINFOEXW *iinfo, HANDLE
info
->
bmiHeader
.
biBitCount
=
32
;
color_size
=
width
*
height
*
4
;
info
->
bmiHeader
.
biSizeImage
=
color_size
;
hbmColor
=
CreateDIBSection
(
hdc
,
info
,
DIB_RGB_COLORS
,
(
VOID
**
)
&
color_bits
,
NULL
,
0
);
hbmColor
=
NtGdiCreateDIBSection
(
hdc
,
NULL
,
0
,
info
,
DIB_RGB_COLORS
,
0
,
0
,
0
,
(
void
**
)
&
color_bits
);
if
(
!
hbmColor
)
{
WARN
(
"failed to create DIB section for cursor color data
\n
"
);
...
...
@@ -597,7 +598,8 @@ static CFArrayRef create_color_cursor(HDC hdc, const ICONINFOEXW *iinfo, HANDLE
mask_size
=
((
width
+
31
)
/
32
*
4
)
*
height
;
/* width_bytes * height */
info
->
bmiHeader
.
biSizeImage
=
mask_size
;
hbmMask
=
CreateDIBSection
(
hdc
,
info
,
DIB_RGB_COLORS
,
(
VOID
**
)
&
mask_bits
,
NULL
,
0
);
hbmMask
=
NtGdiCreateDIBSection
(
hdc
,
NULL
,
0
,
info
,
DIB_RGB_COLORS
,
0
,
0
,
0
,
(
void
**
)
&
mask_bits
);
if
(
!
hbmMask
)
{
WARN
(
"failed to create DIB section for cursor mask data
\n
"
);
...
...
@@ -625,8 +627,8 @@ cleanup:
else
TRACE
(
"returning cursor with %d frames
\n
"
,
nFrames
);
/* Cleanup all of the resources used to obtain the frame data */
if
(
hbmColor
)
DeleteObject
(
hbmColor
);
if
(
hbmMask
)
DeleteObject
(
hbmMask
);
if
(
hbmColor
)
NtGdiDeleteObjectApp
(
hbmColor
);
if
(
hbmMask
)
NtGdiDeleteObjectApp
(
hbmMask
);
HeapFree
(
GetProcessHeap
(),
0
,
info
);
return
frames
;
}
...
...
@@ -748,15 +750,15 @@ void macdrv_SetCursor(HCURSOR cursor)
if
((
cursor_name
=
copy_system_cursor_name
(
&
info
)))
{
DeleteObject
(
info
.
hbmColor
);
DeleteObject
(
info
.
hbmMask
);
NtGdiDeleteObjectApp
(
info
.
hbmColor
);
NtGdiDeleteObjectApp
(
info
.
hbmMask
);
}
else
{
BITMAP
bm
;
HDC
hdc
;
GetObjectW
(
info
.
hbmMask
,
sizeof
(
bm
),
&
bm
);
NtGdiExt
GetObjectW
(
info
.
hbmMask
,
sizeof
(
bm
),
&
bm
);
if
(
!
info
.
hbmColor
)
bm
.
bmHeight
=
max
(
1
,
bm
.
bmHeight
/
2
);
/* make sure hotspot is valid */
...
...
@@ -766,18 +768,18 @@ void macdrv_SetCursor(HCURSOR cursor)
info
.
yHotspot
=
bm
.
bmHeight
/
2
;
}
hdc
=
CreateCompatibleDC
(
0
);
hdc
=
NtGdi
CreateCompatibleDC
(
0
);
if
(
info
.
hbmColor
)
{
cursor_frames
=
create_color_cursor
(
hdc
,
&
info
,
cursor
,
bm
.
bmWidth
,
bm
.
bmHeight
);
DeleteObject
(
info
.
hbmColor
);
NtGdiDeleteObjectApp
(
info
.
hbmColor
);
}
else
cursor_frames
=
create_monochrome_cursor
(
hdc
,
&
info
,
bm
.
bmWidth
,
bm
.
bmHeight
);
DeleteObject
(
info
.
hbmMask
);
DeleteDC
(
hdc
);
NtGdiDeleteObjectApp
(
info
.
hbmMask
);
NtGdiDeleteObjectApp
(
hdc
);
}
if
(
cursor_name
||
cursor_frames
)
...
...
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