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
d82af2f3
Commit
d82af2f3
authored
Aug 29, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Aug 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac.drv: Support enumerating non-primary adapters display modes.
parent
0f014f50
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
display.c
dlls/winemac.drv/display.c
+18
-5
No files found.
dlls/winemac.drv/display.c
View file @
d82af2f3
...
@@ -52,6 +52,7 @@ static const WCHAR pixelencodingW[] = {'P','i','x','e','l','E','n','c','o','d','
...
@@ -52,6 +52,7 @@ static const WCHAR pixelencodingW[] = {'P','i','x','e','l','E','n','c','o','d','
static
CFArrayRef
cached_modes
;
static
CFArrayRef
cached_modes
;
static
DWORD
cached_modes_flags
;
static
DWORD
cached_modes_flags
;
static
CGDirectDisplayID
cached_modes_display_id
;
static
BOOL
cached_modes_has_8bpp
,
cached_modes_has_16bpp
;
static
BOOL
cached_modes_has_8bpp
,
cached_modes_has_16bpp
;
static
int
cached_default_mode_bpp
;
static
int
cached_default_mode_bpp
;
static
pthread_mutex_t
cached_modes_mutex
=
PTHREAD_MUTEX_INITIALIZER
;
static
pthread_mutex_t
cached_modes_mutex
=
PTHREAD_MUTEX_INITIALIZER
;
...
@@ -999,9 +1000,11 @@ BOOL macdrv_EnumDisplaySettingsEx(LPCWSTR devname, DWORD mode, LPDEVMODEW devmod
...
@@ -999,9 +1000,11 @@ BOOL macdrv_EnumDisplaySettingsEx(LPCWSTR devname, DWORD mode, LPDEVMODEW devmod
struct
macdrv_display
*
displays
=
NULL
;
struct
macdrv_display
*
displays
=
NULL
;
int
num_displays
;
int
num_displays
;
CGDisplayModeRef
display_mode
;
CGDisplayModeRef
display_mode
;
int
display_mode_bpp
;
int
display_mode_bpp
,
display_idx
;
BOOL
synthesized
=
FALSE
;
BOOL
synthesized
=
FALSE
;
CGDirectDisplayID
display_id
;
DWORD
count
,
i
;
DWORD
count
,
i
;
WCHAR
*
end
;
TRACE
(
"%s, %u, %p + %hu, %08x
\n
"
,
debugstr_w
(
devname
),
mode
,
devmode
,
devmode
->
dmSize
,
flags
);
TRACE
(
"%s, %u, %p + %hu, %08x
\n
"
,
debugstr_w
(
devname
),
mode
,
devmode
,
devmode
->
dmSize
,
flags
);
...
@@ -1010,13 +1013,23 @@ BOOL macdrv_EnumDisplaySettingsEx(LPCWSTR devname, DWORD mode, LPDEVMODEW devmod
...
@@ -1010,13 +1013,23 @@ BOOL macdrv_EnumDisplaySettingsEx(LPCWSTR devname, DWORD mode, LPDEVMODEW devmod
if
(
macdrv_get_displays
(
&
displays
,
&
num_displays
))
if
(
macdrv_get_displays
(
&
displays
,
&
num_displays
))
goto
failed
;
goto
failed
;
display_idx
=
wcstol
(
devname
+
11
,
&
end
,
10
)
-
1
;
if
(
display_idx
>=
num_displays
)
{
macdrv_free_displays
(
displays
);
return
FALSE
;
}
display_id
=
displays
[
display_idx
].
displayID
;
pthread_mutex_lock
(
&
cached_modes_mutex
);
pthread_mutex_lock
(
&
cached_modes_mutex
);
if
(
mode
==
0
||
!
cached_modes
||
flags
!=
cached_modes_flags
)
if
(
mode
==
0
||
!
cached_modes
||
flags
!=
cached_modes_flags
||
display_id
!=
cached_modes_display_id
)
{
{
if
(
cached_modes
)
CFRelease
(
cached_modes
);
if
(
cached_modes
)
CFRelease
(
cached_modes
);
cached_modes
=
copy_display_modes
(
display
s
[
0
].
displayID
,
(
flags
&
EDS_RAWMODE
)
!=
0
);
cached_modes
=
copy_display_modes
(
display
_id
,
(
flags
&
EDS_RAWMODE
)
!=
0
);
cached_modes_has_8bpp
=
cached_modes_has_16bpp
=
FALSE
;
cached_modes_has_8bpp
=
cached_modes_has_16bpp
=
FALSE
;
cached_modes_display_id
=
display_id
;
cached_modes_flags
=
flags
;
cached_modes_flags
=
flags
;
if
(
cached_modes
)
if
(
cached_modes
)
...
@@ -1096,13 +1109,13 @@ BOOL macdrv_EnumDisplaySettingsEx(LPCWSTR devname, DWORD mode, LPDEVMODEW devmod
...
@@ -1096,13 +1109,13 @@ BOOL macdrv_EnumDisplaySettingsEx(LPCWSTR devname, DWORD mode, LPDEVMODEW devmod
if
(
!
display_mode
)
if
(
!
display_mode
)
goto
failed
;
goto
failed
;
display_mode_to_devmode
(
display
s
[
0
].
displayID
,
display_mode
,
devmode
);
display_mode_to_devmode
(
display
_id
,
display_mode
,
devmode
);
devmode
->
dmBitsPerPel
=
display_mode_bpp
;
devmode
->
dmBitsPerPel
=
display_mode_bpp
;
if
(
devmode
->
dmBitsPerPel
)
if
(
devmode
->
dmBitsPerPel
)
devmode
->
dmFields
|=
DM_BITSPERPEL
;
devmode
->
dmFields
|=
DM_BITSPERPEL
;
if
(
retina_enabled
)
if
(
retina_enabled
)
{
{
struct
display_mode_descriptor
*
desc
=
create_original_display_mode_descriptor
(
display
s
[
0
].
displayID
);
struct
display_mode_descriptor
*
desc
=
create_original_display_mode_descriptor
(
display
_id
);
if
(
display_mode_matches_descriptor
(
display_mode
,
desc
))
if
(
display_mode_matches_descriptor
(
display_mode
,
desc
))
{
{
devmode
->
dmPelsWidth
*=
2
;
devmode
->
dmPelsWidth
*=
2
;
...
...
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