[gtk+] Bug 688710 - splashscreen shouldn't be always on top on OS X
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Bug 688710 - splashscreen shouldn't be always on top on OS X
- Date: Tue, 20 Nov 2012 21:04:32 +0000 (UTC)
commit 4f6e1fdf161747d98970e141e9bfbe7b9ac8771d
Author: Camillo Lugaresi <camillo lugaresi gmail com>
Date: Tue Nov 20 02:52:39 2012 -0600
Bug 688710 - splashscreen shouldn't be always on top on OS X
Activate the "hides on deactivate" behavior for splashscreens,
torn-off menus, utility windows, tooltips and notifications: when
another application is brought to the front, these windows are hidden
so as not to obscure it. This is the expected behavior for
application-specific floating windows on OS X.
(cherry picked from commit 0596f5591f36f57b99103914ba03abbed5765e8b)
gdk/quartz/gdkwindow-quartz.c | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 4165a00..b1bcc48 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -2384,13 +2384,31 @@ window_type_hint_to_shadow (GdkWindowTypeHint hint)
return FALSE;
}
+static gboolean
+window_type_hint_to_hides_on_deactivate (GdkWindowTypeHint hint)
+{
+ switch (hint)
+ {
+ case GDK_WINDOW_TYPE_HINT_UTILITY:
+ case GDK_WINDOW_TYPE_HINT_MENU: /* Torn-off menu */
+ case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
+ case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
+ case GDK_WINDOW_TYPE_HINT_TOOLTIP:
+ return TRUE;
+
+ default:
+ break;
+ }
+
+ return FALSE;
+}
static void
gdk_quartz_window_set_type_hint (GdkWindow *window,
GdkWindowTypeHint hint)
{
GdkWindowImplQuartz *impl;
-
+
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL (window))
return;
@@ -2405,6 +2423,7 @@ gdk_quartz_window_set_type_hint (GdkWindow *window,
[impl->toplevel setHasShadow: window_type_hint_to_shadow (hint)];
[impl->toplevel setLevel: window_type_hint_to_level (hint)];
+ [impl->toplevel setHidesOnDeactivate: window_type_hint_to_hides_on_deactivate (hint)];
}
static GdkWindowTypeHint
@@ -2622,6 +2641,7 @@ gdk_quartz_window_set_decorations (GdkWindow *window,
defer:NO];
[impl->toplevel setHasShadow: window_type_hint_to_shadow (impl->type_hint)];
[impl->toplevel setLevel: window_type_hint_to_level (impl->type_hint)];
+ [impl->toplevel setHidesOnDeactivate: window_type_hint_to_hides_on_deactivate (impl->type_hint)];
[impl->toplevel setContentView:old_view];
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]