[gtk+/gtk-3-22] Convince OS X to fully fullscreen windows



commit cf1e2b904227cbc0bc513693e4798ea50821f2b5
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Feb 28 18:44:33 2017 -0500

    Convince OS X to fully fullscreen windows
    
    We typically want to have the full screen given to
    the content, not the aspect-ratio preserving behavior
    that newer OS X has.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=779383

 gdk/quartz/GdkQuartzNSWindow.c |   15 +++++++++++++++
 gdk/quartz/GdkQuartzNSWindow.h |    1 +
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/gdk/quartz/GdkQuartzNSWindow.c b/gdk/quartz/GdkQuartzNSWindow.c
index 3848117..eca5976 100644
--- a/gdk/quartz/GdkQuartzNSWindow.c
+++ b/gdk/quartz/GdkQuartzNSWindow.c
@@ -840,4 +840,19 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
   inMaximizeTransition = NO;
 }
 
+-(NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize
+{
+  return [[window screen] frame].size;
+}
+
+-(void)windowWillEnterFullScreen:(NSNotification *)aNotification
+{
+  lastUnfullscreenFrame = [self frame];
+}
+
+-(void)windowWillExitFullScreen:(NSNotification *)aNotification
+{
+  [self setFrame:lastUnfullscreenFrame display:YES]
+}
+
 @end
diff --git a/gdk/quartz/GdkQuartzNSWindow.h b/gdk/quartz/GdkQuartzNSWindow.h
index 31175da..b8edf43 100644
--- a/gdk/quartz/GdkQuartzNSWindow.h
+++ b/gdk/quartz/GdkQuartzNSWindow.h
@@ -37,6 +37,7 @@
 
   NSRect  lastUnmaximizedFrame;
   NSRect  lastMaximizedFrame;
+  NSRect  lastUnfullscreenFrame;
   BOOL    inMaximizeTransition;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]