Index: libwnck/window.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/window.c,v
retrieving revision 1.44
diff -u -r1.44 window.c
--- libwnck/window.c	25 Jul 2004 18:04:21 -0000	1.44
+++ libwnck/window.c	27 Jul 2004 20:26:23 -0000
@@ -931,6 +931,33 @@
 }
 
 /**
+ * wnck_window_set_geometry:
+ * @window: a #WnckWindow
+ * @location_x: new X location (X coordinate)
+ * @location_y: new Y location (Y coordinate)
+ * @new_width: new window width (X size)
+ * @new_height: new window height (Y size)
+ *
+ * Sets the size and position of the window.
+ * The X and Y coordinates are relative to the root window.
+ * 
+ **/
+void 
+wnck_window_set_geometry (WnckWindow *window,
+                             gint location_x, gint location_y,
+						     gint new_width, gint new_height)
+{
+  g_return_if_fail (WNCK_IS_WINDOW (window));	
+
+  _wnck_moveresize_window (WNCK_SCREEN_XSCREEN (window->priv->screen),
+		      window->priv->xwindow,
+			  location_x,
+			  location_y,
+			  new_width,
+			  new_height);
+}
+
+/**
  * wnck_window_get_workspace:
  * @window: a #WnckWindow
  *
Index: libwnck/window.h
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/window.h,v
retrieving revision 1.24
diff -u -r1.24 window.h
--- libwnck/window.h	25 Jul 2004 18:04:22 -0000	1.24
+++ libwnck/window.h	27 Jul 2004 20:26:23 -0000
@@ -177,6 +177,11 @@
 void wnck_window_unstick                 (WnckWindow *window);
 void wnck_window_keyboard_move           (WnckWindow *window);
 void wnck_window_keyboard_size           (WnckWindow *window);
+void wnck_window_set_geometry            (WnckWindow *window,
+                                          gint location_x,
+										  gint location_y,
+										  gint new_width,
+										  gint new_height);  
 
 WnckWorkspace* wnck_window_get_workspace     (WnckWindow    *window);
 void           wnck_window_move_to_workspace (WnckWindow    *window,
Index: libwnck/xutils.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/xutils.c,v
retrieving revision 1.45
diff -u -r1.45 xutils.c
--- libwnck/xutils.c	21 Jun 2004 16:48:12 -0000	1.45
+++ libwnck/xutils.c	27 Jul 2004 20:26:25 -0000
@@ -915,6 +915,41 @@
 }
 
 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, //RootWindowOfScreen (screen),  
+              False,
+              SubstructureRedirectMask | SubstructureNotifyMask,
+              &xev); 
+}
+
+
+void
 _wnck_change_state (Screen  *screen,
 		    Window   xwindow,
                     gboolean add,
Index: libwnck/xutils.h
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/xutils.h,v
retrieving revision 1.24
diff -u -r1.24 xutils.h
--- libwnck/xutils.h	21 Jun 2004 16:48:12 -0000	1.24
+++ libwnck/xutils.h	27 Jul 2004 20:26:25 -0000
@@ -124,6 +124,12 @@
 
 void   _wnck_keyboard_size    (Screen *screen,
                                Window  xwindow);
+void   _wnck_moveresize_window (Screen *screen,
+                                Window xwindow, 
+                                gint x, 
+                                gint y, 
+                                gint width, 
+                                gint height);
 
 void _wnck_toggle_showing_desktop (Screen  *screen,
                                    gboolean show);
