Re: Xinerama maximization of windows



Mark McLoughlin <mark skynet ie> writes:
> > The maximization should be to the work area on a single physical
> > screen. That is, a window should fill the physical screen it mostly
> > overlaps, avoiding the panels. The code in theory already does this,
> > but I haven't really tested it due to another bug.
> 
> 	How does that work? There's only a single root window per
> logical screen (not physical screen) in Xinerama, no? Hence, there's
> only one workarea ...

Well, here is how it works at the moment, for better or worse:

void
meta_window_get_work_area (MetaWindow    *window,
                           gboolean       for_current_xinerama,
                           MetaRectangle *area)
{
  MetaRectangle space_area;
  GList *tmp;
  
  int left_strut;
  int right_strut;
  int top_strut;
  int bottom_strut;  

  if (for_current_xinerama)
    {
      const MetaXineramaScreenInfo *xinerama;
      
      xinerama = meta_screen_get_xinerama_for_window (window->screen,
                                                      window);
      
      left_strut = xinerama->x_origin;
      right_strut = window->screen->width - xinerama->width -
      xinerama->x_origin;
      top_strut = xinerama->y_origin;
      bottom_strut = window->screen->height - xinerama->height -
      xinerama->y_origin;
    }
  else
    {
      left_strut = 0;
      right_strut = 0;
      top_strut = 0;
      bottom_strut = 0;
    }
      
  tmp = meta_window_get_workspaces (window);
  
  while (tmp != NULL)
    {
      meta_workspace_get_work_area (tmp->data, &space_area);

      left_strut = MAX (left_strut, space_area.x);
      right_strut = MAX (right_strut,
                         (window->screen->width - space_area.x -
      space_area.width));
      top_strut = MAX (top_strut, space_area.y);
      bottom_strut = MAX (bottom_strut,
                          (window->screen->height - space_area.y -
      space_area.height));      
      
      tmp = tmp->next;
    }
  
  area->x = left_strut;
  area->y = top_strut;
  area->width = window->screen->width - left_strut - right_strut;
  area->height = window->screen->height - top_strut - bottom_strut;

  meta_topic (META_DEBUG_WORKAREA,
              "Window %s has work area %d,%d %d x %d\n",
              window->desc, area->x, area->y, area->width,
              area->height);
}

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]