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
ce5a87b1
Commit
ce5a87b1
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: Simplify display mode code.
When originalDisplayModes has entries, the app is active. When the app is active, latentDisplayModes is empty.
parent
d4d92a75
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
22 deletions
+9
-22
cocoa_app.m
dlls/winemac.drv/cocoa_app.m
+9
-22
No files found.
dlls/winemac.drv/cocoa_app.m
View file @
ce5a87b1
...
...
@@ -709,7 +709,6 @@ int macdrv_err_on;
-
(
BOOL
)
setMode
:
(
CGDisplayModeRef
)
mode
forDisplay
:
(
CGDirectDisplayID
)
displayID
{
BOOL
ret
=
FALSE
;
BOOL
active
=
[
NSApp
isActive
];
NSNumber
*
displayIDKey
=
[
NSNumber
numberWithUnsignedInt
:
displayID
];
CGDisplayModeRef
originalMode
;
...
...
@@ -719,39 +718,28 @@ int macdrv_err_on;
{
if
([
originalDisplayModes
count
]
==
1
)
// If this is the last changed display, do a blanket reset
{
if
(
active
)
{
CGRestorePermanentDisplayConfiguration
();
if
(
!
displaysCapturedForFullscreen
)
CGReleaseAllDisplays
();
}
CGRestorePermanentDisplayConfiguration
();
if
(
!
displaysCapturedForFullscreen
)
CGReleaseAllDisplays
();
[
originalDisplayModes
removeAllObjects
];
[
latentDisplayModes
removeAllObjects
];
ret
=
TRUE
;
}
else
// ... otherwise, try to restore just the one display
{
if
(
active
)
mode
=
[
self
modeMatchingMode
:
mode
forDisplay
:
displayID
];
if
(
mode
&&
CGDisplaySetDisplayMode
(
displayID
,
mode
,
NULL
)
==
CGDisplayNoErr
)
{
mode
=
[
self
modeMatchingMode
:
mode
forDisplay
:
displayID
];
if
(
mode
)
ret
=
(
CGDisplaySetDisplayMode
(
displayID
,
mode
,
NULL
)
==
CGDisplayNoErr
);
}
else
{
[
latentDisplayModes
removeObjectForKey
:
displayIDKey
];
[
originalDisplayModes
removeObjectForKey
:
displayIDKey
];
ret
=
TRUE
;
}
if
(
ret
)
[
originalDisplayModes
removeObjectForKey
:
displayIDKey
];
}
}
else
{
CGDisplayModeRef
currentMode
=
NULL
;
BOOL
active
=
[
NSApp
isActive
];
CGDisplayModeRef
currentMode
;
if
(
!
active
)
currentMode
=
CGDisplayModeRetain
((
CGDisplayModeRef
)[
latentDisplayModes
objectForKey
:
displayIDKey
]);
currentMode
=
CGDisplayModeRetain
((
CGDisplayModeRef
)[
latentDisplayModes
objectForKey
:
displayIDKey
]);
if
(
!
currentMode
)
currentMode
=
CGDisplayCopyDisplayMode
(
displayID
);
if
(
!
currentMode
)
// Invalid display ID
...
...
@@ -790,7 +778,6 @@ int macdrv_err_on;
else
if
(
!
[
originalDisplayModes
count
])
{
CGRestorePermanentDisplayConfiguration
();
[
latentDisplayModes
removeAllObjects
];
if
(
!
displaysCapturedForFullscreen
)
CGReleaseAllDisplays
();
}
...
...
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