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
c072a456
Commit
c072a456
authored
Jan 10, 2014
by
Ken Thomases
Committed by
Alexandre Julliard
Jan 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: For ChangeDisplaySettingsEx(), if caller didn't specify, prefer…
winemac: For ChangeDisplaySettingsEx(), if caller didn't specify, prefer non-interlaced and unstretched modes.
parent
ce5a87b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
24 deletions
+48
-24
display.c
dlls/winemac.drv/display.c
+48
-24
No files found.
dlls/winemac.drv/display.c
View file @
c072a456
...
...
@@ -235,7 +235,9 @@ LONG CDECL macdrv_ChangeDisplaySettingsEx(LPCWSTR devname, LPDEVMODEW devmode,
struct
macdrv_display
*
displays
;
int
num_displays
;
CFArrayRef
display_modes
;
CFIndex
count
,
i
,
safe
;
CFIndex
count
,
i
,
safe
,
best
;
CGDisplayModeRef
best_display_mode
;
uint32_t
best_io_flags
;
TRACE
(
"%s %p %p 0x%08x %p
\n
"
,
debugstr_w
(
devname
),
devmode
,
hwnd
,
flags
,
lpvoid
);
...
...
@@ -299,6 +301,7 @@ LONG CDECL macdrv_ChangeDisplaySettingsEx(LPCWSTR devname, LPDEVMODEW devmode,
TRACE
(
"
\n
"
);
safe
=
-
1
;
best_display_mode
=
NULL
;
count
=
CFArrayGetCount
(
display_modes
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
...
...
@@ -334,57 +337,78 @@ LONG CDECL macdrv_ChangeDisplaySettingsEx(LPCWSTR devname, LPDEVMODEW devmode,
if
(
devmode
->
dmDisplayFrequency
!=
(
DWORD
)
refresh_rate
)
continue
;
}
if
(
devmode
->
dmFields
&
DM_DISPLAYFLAGS
)
{
if
(
!
(
devmode
->
dmDisplayFlags
&
DM_INTERLACED
)
!=
!
(
io_flags
&
kDisplayModeInterlacedFlag
))
continue
;
}
else
if
(
best_display_mode
)
{
if
(
io_flags
&
kDisplayModeInterlacedFlag
&&
!
(
best_io_flags
&
kDisplayModeInterlacedFlag
))
continue
;
else
if
(
!
(
io_flags
&
kDisplayModeInterlacedFlag
)
&&
best_io_flags
&
kDisplayModeInterlacedFlag
)
goto
better
;
}
if
(
devmode
->
dmFields
&
DM_DISPLAYFIXEDOUTPUT
)
{
if
(
!
(
devmode
->
dmDisplayFixedOutput
==
DMDFO_STRETCH
)
!=
!
(
io_flags
&
kDisplayModeStretchedFlag
))
continue
;
}
if
(
devmode
->
dmFields
&
DM_DISPLAYFLAGS
)
else
if
(
best_display_mode
)
{
if
(
!
(
devmode
->
dmDisplayFlags
&
DM_INTERLACED
)
!=
!
(
io_flags
&
kDisplayModeInterlac
edFlag
))
if
(
io_flags
&
kDisplayModeStretchedFlag
&&
!
(
best_io_flags
&
kDisplayModeStretch
edFlag
))
continue
;
else
if
(
!
(
io_flags
&
kDisplayModeStretchedFlag
)
&&
best_io_flags
&
kDisplayModeStretchedFlag
)
goto
better
;
}
if
(
best_display_mode
)
continue
;
better:
best_display_mode
=
display_mode
;
best
=
safe
;
best_io_flags
=
io_flags
;
}
if
(
best_display_mode
)
{
/* we have a valid mode */
TRACE
(
"Requested display settings match mode %ld
\n
"
,
safe
);
TRACE
(
"Requested display settings match mode %ld
\n
"
,
best
);
if
((
flags
&
CDS_UPDATEREGISTRY
)
&&
!
write_registry_settings
(
devmode
))
{
WARN
(
"Failed to update registry
\n
"
);
ret
=
DISP_CHANGE_NOTUPDATED
;
break
;
}
else
if
(
flags
&
(
CDS_TEST
|
CDS_NORESET
))
ret
=
DISP_CHANGE_SUCCESSFUL
;
else
if
(
macdrv_set_display_mode
(
&
displays
[
0
],
best_display_mode
))
{
int
mode_bpp
=
display_mode_bits_per_pixel
(
best_display_mode
);
size_t
width
=
CGDisplayModeGetWidth
(
best_display_mode
);
size_t
height
=
CGDisplayModeGetHeight
(
best_display_mode
);
if
(
flags
&
(
CDS_TEST
|
CDS_NORESET
))
SendMessageW
(
GetDesktopWindow
(),
WM_MACDRV_UPDATE_DESKTOP_RECT
,
mode_bpp
,
MAKELPARAM
(
width
,
height
));
ret
=
DISP_CHANGE_SUCCESSFUL
;
}
else
{
if
(
macdrv_set_display_mode
(
&
displays
[
0
],
display_mode
))
{
SendMessageW
(
GetDesktopWindow
(),
WM_MACDRV_UPDATE_DESKTOP_RECT
,
mode_bpp
,
MAKELPARAM
(
width
,
height
));
ret
=
DISP_CHANGE_SUCCESSFUL
;
}
else
{
WARN
(
"Failed to set display mode
\n
"
);
ret
=
DISP_CHANGE_FAILED
;
}
WARN
(
"Failed to set display mode
\n
"
);
ret
=
DISP_CHANGE_FAILED
;
}
break
;
}
CFRelease
(
display_modes
);
macdrv_free_displays
(
displays
);
if
(
i
>=
count
)
else
{
/* no valid modes found */
ERR
(
"No matching mode found %ux%ux%d @%u!
\n
"
,
devmode
->
dmPelsWidth
,
devmode
->
dmPelsHeight
,
bpp
,
devmode
->
dmDisplayFrequency
);
}
CFRelease
(
display_modes
);
macdrv_free_displays
(
displays
);
return
ret
;
}
...
...
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