[gtk+/gtk-3-8] quartz: move dialogs to the same window level as utility windows



commit 044e34b34fafccc711db711a8b2c30d25637e254
Author: Michael Natterer <mitch gimp org>
Date:   Thu Jun 6 15:39:53 2013 +0200

    quartz: move dialogs to the same window level as utility windows
    
    window_type_hint_to_level(): applied patch from Paul Davis which moves
    dialogs to NSFloatingWindowLevel. This is not quite the perfect
    solution, but it's a pragmatic fix that makes apps which have both
    window types much more usable, and prevents dialog from disappearing
    under an application's main window.
    (cherry picked from commit 59d49e1566faeed80d2b2052c42fe6c5e9153190)

 gdk/quartz/gdkwindow-quartz.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 5550fa8..555cfbb 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -2338,14 +2338,18 @@ window_type_hint_to_level (GdkWindowTypeHint hint)
       return NSTornOffMenuWindowLevel;
 
     case GDK_WINDOW_TYPE_HINT_DOCK:
+      return NSFloatingWindowLevel; /* NSDockWindowLevel is deprecated, and not replaced */
+
     case GDK_WINDOW_TYPE_HINT_UTILITY:
+    case GDK_WINDOW_TYPE_HINT_DIALOG:  /* Dialog window */
       return NSFloatingWindowLevel;
 
     case GDK_WINDOW_TYPE_HINT_NORMAL:  /* Normal toplevel window */
-    case GDK_WINDOW_TYPE_HINT_DIALOG:  /* Dialog window */
     case GDK_WINDOW_TYPE_HINT_TOOLBAR: /* Window used to implement toolbars */
-    case GDK_WINDOW_TYPE_HINT_DESKTOP: /* N/A */
-      break;
+      return NSNormalWindowLevel;
+
+    case GDK_WINDOW_TYPE_HINT_DESKTOP:
+      return kCGDesktopWindowLevelKey; /* doesn't map to any real Cocoa model */
 
     default:
       break;


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