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.
This commit is contained in:
committed by
Michael Natterer
parent
27f3fcf12c
commit
0596f5591f
@@ -2460,13 +2460,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;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_window_set_type_hint (GdkWindow *window,
|
||||
GdkWindowTypeHint hint)
|
||||
{
|
||||
GdkWindowImplQuartz *impl;
|
||||
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window) ||
|
||||
!WINDOW_IS_TOPLEVEL (window))
|
||||
return;
|
||||
@@ -2481,6 +2499,7 @@ gdk_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)];
|
||||
}
|
||||
|
||||
GdkWindowTypeHint
|
||||
@@ -2702,6 +2721,7 @@ gdk_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];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user