/* wmbottom.c (emx+gcc) -- Copyright (c) 1987-1993 by Eberhard Mattes */

#include <sys/winmgr.h>
#include "winmgr2.h"

void wm_bottom (wm_handle wh)
{
  int i, idx;
  wm_handle p;

  if (wh->used != WM_USED)
    return;
  idx = _wm_idx1 (wh);
  if (idx < 0)
    return;
  for (i = idx; i-1 >= 0; --i)
    _wm_idx[i] = _wm_idx[i-1];
  _wm_idx[0] = wh;
  _wm_hide1 ();
  for (i = 1; i <= idx; ++i)
    {
      p = _wm_idx[i];
      if (p->open && _wm_jam1 (p, wh))
        _wm_put1 (p);
    }
}
