Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
35a1f5fb
Commit
35a1f5fb
authored
Jan 02, 2011
by
Sam Lantinga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed restoring the desktop resolution when toggling fullscreen mode
parent
2ccdb31c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
SDL_cocoamodes.m
src/video/cocoa/SDL_cocoamodes.m
+10
-9
No files found.
src/video/cocoa/SDL_cocoamodes.m
View file @
35a1f5fb
...
...
@@ -248,27 +248,29 @@ Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
SDL_DisplayModeData
*
data
=
(
SDL_DisplayModeData
*
)
mode
->
driverdata
;
CGDisplayFadeReservationToken
fade_token
=
kCGDisplayFadeReservationInvalidToken
;
CGError
result
;
/* Fade to black to hide resolution-switching flicker */
if
(
CGAcquireDisplayFadeReservation
(
5
,
&
fade_token
)
==
kCGErrorSuccess
)
{
CGDisplayFade
(
fade_token
,
0
.
3
,
kCGDisplayBlendNormal
,
kCGDisplayBlendSolidColor
,
0
.
0
,
0
.
0
,
0
.
0
,
TRUE
);
}
/* Put up the blanking window (a window above all other windows) */
result
=
CGDisplayCapture
(
displaydata
->
display
);
if
(
result
!=
kCGErrorSuccess
)
{
CG_SetError
(
"CGDisplayCapture()"
,
result
);
goto
ERR_NO_CAPTURE
;
}
if
(
data
==
display
->
desktop_mode
.
driverdata
)
{
/* Restoring desktop mode */
CGDisplaySwitchToMode
(
displaydata
->
display
,
data
->
moderef
);
CGDisplayRelease
(
displaydata
->
display
);
if
(
CGDisplayIsMain
(
displaydata
->
display
))
{
ShowMenuBar
();
}
}
else
{
/* Put up the blanking window (a window above all other windows) */
result
=
CGDisplayCapture
(
displaydata
->
display
);
if
(
result
!=
kCGErrorSuccess
)
{
CG_SetError
(
"CGDisplayCapture()"
,
result
);
goto
ERR_NO_CAPTURE
;
}
/* Do the physical switch */
result
=
CGDisplaySwitchToMode
(
displaydata
->
display
,
data
->
moderef
);
if
(
result
!=
kCGErrorSuccess
)
{
...
...
@@ -326,7 +328,6 @@ Cocoa_QuitModes(_THIS)
Cocoa_SetDisplayMode
(
_this
,
display
,
&
display
->
desktop_mode
);
}
}
CGReleaseAllDisplays
();
ShowMenuBar
();
}
...
...
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