// exceprt from libwnck/xutils.c (dev. version)

void
_wnck_moveresize_window (Screen *screen,
                         Window xwindow, 
                         gint x, 
                         gint y, 
                         gint width, 
                         gint height)
{
  XEvent xev;
  
  xev.xclient.type = ClientMessage;
  xev.xclient.serial = 0;
  xev.xclient.send_event = True;
  xev.xclient.display = gdk_display;
  xev.xclient.window = xwindow;
  xev.xclient.message_type = _wnck_atom_get ("_NET_MOVERESIZE_WINDOW");
  xev.xclient.format = 32;
  /*
  use WM_SIZE_HINTS.win_gravity and turn on the x,y,width,height flags
  (see http://freedesktop.org/Standards/wm-spec/1.3/ar01s04.html)
  */
  xev.xclient.data.l[0] = 0|0x000F;
  xev.xclient.data.l[1] = x; 
  xev.xclient.data.l[2] = y;
  xev.xclient.data.l[3] = width; 
  xev.xclient.data.l[4] = height; 

  XSendEvent (gdk_display,
              xwindow, //also tried: RootWindowOfScreen (screen),  
              False,
              SubstructureRedirectMask | SubstructureNotifyMask,
              &xev); 
}

