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
239f2180
Commit
239f2180
authored
Apr 03, 2023
by
Alexandros Frantzis
Committed by
Alexandre Julliard
Apr 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac.drv: Extract function to get the current mode.
Signed-off-by:
Alexandros Frantzis
<
alexandros.frantzis@collabora.com
>
parent
ae231451
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
22 deletions
+28
-22
display.c
dlls/winemac.drv/display.c
+28
-22
No files found.
dlls/winemac.drv/display.c
View file @
239f2180
...
...
@@ -864,6 +864,33 @@ static DEVMODEW *display_get_modes(CGDirectDisplayID display_id, int *modes_coun
return
devmodes
;
}
static
void
display_get_current_mode
(
struct
macdrv_display
*
display
,
DEVMODEW
*
devmode
)
{
CGDisplayModeRef
display_mode
;
CGDirectDisplayID
display_id
;
display_id
=
display
->
displayID
;
display_mode
=
CGDisplayCopyDisplayMode
(
display_id
);
devmode
->
dmPosition
.
x
=
CGRectGetMinX
(
display
->
frame
);
devmode
->
dmPosition
.
y
=
CGRectGetMinY
(
display
->
frame
);
devmode
->
dmFields
|=
DM_POSITION
;
display_mode_to_devmode
(
display_id
,
display_mode
,
devmode
);
if
(
retina_enabled
)
{
struct
display_mode_descriptor
*
desc
=
create_original_display_mode_descriptor
(
display_id
);
if
(
display_mode_matches_descriptor
(
display_mode
,
desc
))
{
devmode
->
dmPelsWidth
*=
2
;
devmode
->
dmPelsHeight
*=
2
;
}
free_display_mode_descriptor
(
desc
);
}
CFRelease
(
display_mode
);
}
/***********************************************************************
* GetCurrentDisplaySettings (MACDRV.@)
*
...
...
@@ -872,8 +899,6 @@ BOOL macdrv_GetCurrentDisplaySettings(LPCWSTR devname, BOOL is_primary, LPDEVMOD
{
struct
macdrv_display
*
displays
=
NULL
;
int
num_displays
,
display_idx
;
CGDisplayModeRef
display_mode
;
CGDirectDisplayID
display_id
;
WCHAR
*
end
;
TRACE
(
"%s, %u, %p + %hu
\n
"
,
debugstr_w
(
devname
),
is_primary
,
devmode
,
devmode
->
dmSize
);
...
...
@@ -890,26 +915,7 @@ BOOL macdrv_GetCurrentDisplaySettings(LPCWSTR devname, BOOL is_primary, LPDEVMOD
return
FALSE
;
}
display_id
=
displays
[
display_idx
].
displayID
;
display_mode
=
CGDisplayCopyDisplayMode
(
display_id
);
devmode
->
dmPosition
.
x
=
CGRectGetMinX
(
displays
[
display_idx
].
frame
);
devmode
->
dmPosition
.
y
=
CGRectGetMinY
(
displays
[
display_idx
].
frame
);
devmode
->
dmFields
|=
DM_POSITION
;
display_mode_to_devmode
(
display_id
,
display_mode
,
devmode
);
if
(
retina_enabled
)
{
struct
display_mode_descriptor
*
desc
=
create_original_display_mode_descriptor
(
display_id
);
if
(
display_mode_matches_descriptor
(
display_mode
,
desc
))
{
devmode
->
dmPelsWidth
*=
2
;
devmode
->
dmPelsHeight
*=
2
;
}
free_display_mode_descriptor
(
desc
);
}
CFRelease
(
display_mode
);
display_get_current_mode
(
&
displays
[
display_idx
],
devmode
);
macdrv_free_displays
(
displays
);
TRACE
(
"current mode -- %dx%d-%dx%dx%dbpp @%d Hz"
,
...
...
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