MetaScreen: Add tracking of whether there are fullscreen windows

Trying to track the fullscreen status outside of Mutter, as GNOME Shell
was doing previously, was very prone to errors, because Mutter has a
very tricky definition of when a window is set to be fullscreen and
*actually* acting like a fullscreen window.

 * Add meta_screen_get_monitor_in_fullscreen() and an
   ::in-fullscreen-changed signal. This allows an application to
   track when there are fullscreen windows on a monitor.

 * Do the computation of fullscreen status in a "later" function that
   runs after showing, so we properly take focus into account.

 * To get ordering of different phases right, add more values
   to MetaLaterType.

 * Add auto-minimization, similar to what was added to GNOME Shell
   earlier in this cycle - if a window is set to be fullscreen, but
   not actually fullscreen, minimize.

https://bugzilla.gnome.org/show_bug.cgi?id=649748
This commit is contained in:
Owen W. Taylor
2013-03-14 16:55:49 -04:00
parent 49df033b4e
commit 5ceffe86ee
8 changed files with 198 additions and 2 deletions

View File

@ -395,6 +395,8 @@ get_maximum_layer_in_group (MetaWindow *window)
static void
compute_layer (MetaWindow *window)
{
MetaStackLayer old_layer = window->layer;
window->layer = get_standalone_layer (window);
/* We can only do promotion-due-to-group for dialogs and other
@ -430,6 +432,10 @@ compute_layer (MetaWindow *window)
meta_topic (META_DEBUG_STACK, "Window %s on layer %u type = %u has_focus = %d\n",
window->desc, window->layer,
window->type, window->has_focus);
if (window->layer != old_layer &&
(old_layer == META_LAYER_FULLSCREEN || window->layer == META_LAYER_FULLSCREEN))
meta_screen_queue_check_fullscreen (window->screen);
}
/* Front of the layer list is the topmost window,