File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -763,10 +763,7 @@ - (void)doCommandBySelector:(SEL)selector
763763// GLFW window class
764764// ------------------------------------------------------------------------
765765
766- @interface GLFWWindow : NSWindow {
767- NSRect preFullScreenFrame;
768-
769- }
766+ @interface GLFWWindow : NSWindow {}
770767@end
771768
772769@implementation GLFWWindow
@@ -782,25 +779,9 @@ - (BOOL)canBecomeMainWindow
782779 return YES ;
783780}
784781
785-
786- - (void )toggleFullScreen : (id )sender {
787- // NSLog(@"Custom resize handled instead of native fullscreen");
788- NSScreen *screen = [NSScreen mainScreen ];
789- NSRect screenFrame = [screen visibleFrame ];
790- NSRect currentFrame = [self frame ];
791-
792- BOOL isCurrentlyFullscreen = NSEqualRects (currentFrame, screenFrame);
793-
794- if (isCurrentlyFullscreen) {
795- // Restore previous size only if we have a stored frame
796- if (!NSEqualRects (preFullScreenFrame, NSZeroRect )) {
797- [self setFrame: preFullScreenFrame display: YES animate: YES ];
798- preFullScreenFrame = NSZeroRect ; // Reset
799- }
800- } else {
801- preFullScreenFrame = currentFrame;
802- [self setFrame: screenFrame display: YES animate: YES ]; // Go fullscreen
803- }
782+ - (void )toggleFullScreen : (id )sender
783+ {
784+ [self zoom: sender];
804785}
805786
806787@end
You can’t perform that action at this time.
0 commit comments