/* wmtop.c (emx+gcc) -- Copyright (c) 1987-1993 by Eberhard Mattes */

#include <sys/winmgr.h>
#include "winmgr2.h"

void wm_top (wm_handle wh)
{
  int i, idx;

  if (wh->used != WM_USED)
    return;
  idx = _wm_idx1 (wh);
  if (idx < 0)
    return;
  for (i = idx; i+1 < _wm_count; ++i)
    _wm_idx[i] = _wm_idx[i+1];
  _wm_idx[_wm_count-1] = wh;
  _wm_hide1 ();                                 /* Hide lower windows      */
  _wm_put1 (wh);                                /* Restore window contents */
}
