[gtk+/gtk-2-24] Improve fullscreen behavior on recent OS X



commit 876b5f75faab5d8f3c60c3ec035b2ecd4ac5b67e
Author: Paul Davis <gnome equalarea com>
Date:   Wed Jun 29 04:32:00 2016 +0000

    Improve fullscreen behavior on recent OS X
    
    Avoid windows getting "stuck" (be undraggable) and/or have a locked lower
    right corner after exiting fullscreen mode.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=768163

 gdk/quartz/gdkwindow-quartz.c |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 7cd7789..a7ee444 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -3003,7 +3003,14 @@ gdk_window_fullscreen (GdkWindow *window)
       clear_toplevel_order ();
     }
 
-  SetSystemUIMode (kUIModeAllHidden, kUIOptionAutoShowMenuBar);
+  if ([NSWindow respondsToSelector:@selector(toggleFullScreen:)])
+    {
+       [impl->toplevel toggleFullScreen:nil];
+    }
+  else
+    {
+      SetSystemUIMode (kUIModeAllHidden, kUIOptionAutoShowMenuBar);
+    }
 
   gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN);
 }
@@ -3022,14 +3029,21 @@ gdk_window_unfullscreen (GdkWindow *window)
   geometry = get_fullscreen_geometry (window);
   if (geometry)
     {
-      SetSystemUIMode (kUIModeNormal, 0);
+      if ([NSWindow respondsToSelector:@selector(toggleFullScreen:)])
+        {
+          [impl->toplevel toggleFullScreen:nil];
+        }
+      else
+        {
+         SetSystemUIMode (kUIModeNormal, 0);
+       }
 
       move_resize_window_internal (window,
                                    geometry->x,
                                    geometry->y,
                                    geometry->width,
                                    geometry->height);
-      
+
       gdk_window_set_decorations (window, geometry->decor);
 
       g_object_set_data (G_OBJECT (window), FULLSCREEN_DATA, NULL);


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