Beispiel #1
0
/*
 * Sort stack->sorted with layers having priority over stack_position.
 */
static void
stack_do_resort (MetaStack *stack)
{
  if (!stack->need_resort)
    return;
  
  meta_topic (META_DEBUG_STACK,
              "Sorting stack list\n");
      
  stack->sorted = g_list_sort (stack->sorted,
                               (GCompareFunc) compare_window_position);

  meta_screen_queue_check_fullscreen (stack->screen);

  stack->need_resort = FALSE;
}
Beispiel #2
0
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
   * transients, or weird stuff happens like the desktop window and
   * nautilus windows getting in the same layer, or all gnome-terminal
   * windows getting in fullscreen layer if any terminal is
   * fullscreen.
   */
  if (window->layer != META_LAYER_DESKTOP &&
      WINDOW_HAS_TRANSIENT_TYPE(window) &&
      (window->xtransient_for == None ||
       window->transient_parent_is_root_window))
    {
      /* We only do the group thing if the dialog is NOT transient for
       * a particular window. Imagine a group with a normal window, a dock,
       * and a dialog transient for the normal window; you don't want the dialog
       * above the dock if it wouldn't normally be.
       */
      
      MetaStackLayer group_max;
      
      group_max = get_maximum_layer_in_group (window);
      
      if (group_max > window->layer)
        {
          meta_topic (META_DEBUG_STACK,
                      "Promoting window %s from layer %u to %u due to group membership\n",
                      window->desc, window->layer, group_max);
          window->layer = group_max;
        }
    }

  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);
}