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 0596f5591f)
This commit is contained in:
Camillo Lugaresi 2012-11-20 02:52:39 -06:00 committed by Michael Natterer
parent ddceddaa84
commit 4f6e1fdf16

View File

@ -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];
}