Index: libwnck/pager.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/pager.c,v
retrieving revision 1.35
diff -p -u -r1.35 pager.c
--- libwnck/pager.c	22 Oct 2003 00:04:24 -0000	1.35
+++ libwnck/pager.c	2 Mar 2004 00:55:52 -0000
@@ -1135,7 +1135,7 @@ wnck_pager_button_release (GtkWidget    
               wnck_window_move_to_workspace (pager->priv->drag_window,
                                              space);
               if (space == wnck_screen_get_active_workspace (pager->priv->screen))
-                wnck_window_activate (pager->priv->drag_window);
+                wnck_window_activate (pager->priv->drag_window, event->time);
             }	  
 	}
       
@@ -1162,7 +1162,7 @@ wnck_pager_button_release (GtkWidget    
                                          viewport_x, viewport_y);
               
               if (pager->priv->drag_window)
-                wnck_window_activate (pager->priv->drag_window);
+                wnck_window_activate (pager->priv->drag_window, event->time);
             }
 	}
       
Index: libwnck/tasklist.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/tasklist.c,v
retrieving revision 1.56
diff -p -u -r1.56 tasklist.c
--- libwnck/tasklist.c	10 Dec 2003 11:39:39 -0000	1.56
+++ libwnck/tasklist.c	2 Mar 2004 00:55:55 -0000
@@ -1783,7 +1783,7 @@ wnck_task_menu_activated (GtkMenuItem *m
 }
 
 static void
-wnck_tasklist_activate_task_window     (WnckTask *task)
+wnck_tasklist_activate_task_window (WnckTask *task)
 {
   WnckTasklist *tasklist;
   WnckWindowState state;
@@ -1807,7 +1807,8 @@ wnck_tasklist_activate_task_window     (
 	  !tasklist->priv->switch_workspace_on_unminimize)
 	wnck_workspace_activate (window_ws);
 	  
-      wnck_window_activate_transient (task->window);
+      wnck_window_activate_transient (task->window,
+                                      gtk_get_current_event_time ());
     }
   else
     {
@@ -1825,7 +1826,8 @@ wnck_tasklist_activate_task_window     (
           if (window_ws)
             wnck_workspace_activate (window_ws);
 
-	  wnck_window_activate_transient (task->window);
+	  wnck_window_activate_transient (task->window,
+                                          gtk_get_current_event_time ());
 	}
     }
   
@@ -2238,7 +2240,8 @@ wnck_task_motion_timeout (gpointer data)
 
   task->button_activate = 0;
 
-  wnck_window_activate_transient (task->window);
+  wnck_window_activate_transient (task->window,
+                                  gtk_get_current_event_time ());
 
   return FALSE;
 }
Index: libwnck/test-wnck.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/test-wnck.c,v
retrieving revision 1.12
diff -p -u -r1.12 test-wnck.c
--- libwnck/test-wnck.c	25 Sep 2002 02:36:53 -0000	1.12
+++ libwnck/test-wnck.c	2 Mar 2004 00:55:56 -0000
@@ -716,7 +716,7 @@ selection_func (GtkTreeSelection  *selec
         return TRUE;
       else
         {
-          wnck_window_activate (window);
+          wnck_window_activate (window, 0);
           return FALSE;
         }
     }
Index: libwnck/window.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/window.c,v
retrieving revision 1.42
diff -p -u -r1.42 window.c
--- libwnck/window.c	2 Jan 2004 13:05:51 -0000	1.42
+++ libwnck/window.c	2 Mar 2004 00:55:57 -0000
@@ -998,17 +998,19 @@ wnck_window_unpin (WnckWindow *window)
 /**
  * wnck_window_activate:
  * @window: a #WnckWindow
+ * @timestamp: an X server timestamp
  *
  * Ask the window manager to make @window the active window.  The
  * window manager may choose to raise @window along with focusing it.
  **/
 void
-wnck_window_activate (WnckWindow *window)
+wnck_window_activate (WnckWindow *window, guint32 timestamp)
 {
   g_return_if_fail (WNCK_IS_WINDOW (window));
 
   _wnck_activate (WNCK_SCREEN_XSCREEN (window->priv->screen),
-		  window->priv->xwindow);
+		  window->priv->xwindow,
+		  (Time) timestamp);
 }
 
 /**
@@ -1057,6 +1059,7 @@ find_last_transient_for (GList *windows,
 /**
  * wnck_window_activate_transient:
  * @window: a #WnckWindow
+ * @timestamp: an X server timestamp
  *
  * If @window has transients, activates the most likely transient
  * instead of the window itself. Otherwise activates @window.
@@ -1067,7 +1070,7 @@ find_last_transient_for (GList *windows,
  * 
  **/
 void
-wnck_window_activate_transient (WnckWindow *window)
+wnck_window_activate_transient (WnckWindow *window, guint32 timestamp)
 {
   GList *windows;
   WnckWindow *transient;
@@ -1099,11 +1102,11 @@ wnck_window_activate_transient (WnckWind
       /* Raise but don't focus the main window */
       XRaiseWindow (gdk_display, window->priv->xwindow);
       /* then activate the transient */
-      wnck_window_activate (transient);
+      wnck_window_activate (transient, timestamp);
     }
   else
     {
-      wnck_window_activate (window);
+      wnck_window_activate (window, timestamp);
     }
 }
 
Index: libwnck/window.h
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/window.h,v
retrieving revision 1.22
diff -p -u -r1.22 window.h
--- libwnck/window.h	22 Nov 2003 23:49:12 -0000	1.22
+++ libwnck/window.h	2 Mar 2004 00:55:58 -0000
@@ -184,9 +184,11 @@ gboolean wnck_window_is_pinned (WnckWind
 void     wnck_window_pin       (WnckWindow *window);
 void     wnck_window_unpin     (WnckWindow *window);
 
-void     wnck_window_activate  (WnckWindow *window);
+void     wnck_window_activate  (WnckWindow *window,
+                                guint32     timestamp);
 gboolean wnck_window_is_active (WnckWindow *window);
-void     wnck_window_activate_transient (WnckWindow *window);
+void     wnck_window_activate_transient (WnckWindow *window,
+                                         guint32     timestamp);
 
 
 GdkPixbuf* wnck_window_get_icon      (WnckWindow *window);
Index: libwnck/xutils.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/xutils.c,v
retrieving revision 1.43
diff -p -u -r1.43 xutils.c
--- libwnck/xutils.c	31 Jul 2003 09:35:29 -0000	1.43
+++ libwnck/xutils.c	2 Mar 2004 00:56:00 -0000
@@ -834,15 +834,14 @@ _wnck_close (Screen *screen,
   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_CLOSE_WINDOW");
   xev.xclient.format = 32;
   xev.xclient.data.l[0] = 0;
   xev.xclient.data.l[1] = 0;
   xev.xclient.data.l[2] = 0;
+  xev.xclient.data.l[3] = 0;
+  xev.xclient.data.l[4] = 0;
 
   XSendEvent (gdk_display,
               RootWindowOfScreen (screen),
@@ -870,9 +869,6 @@ _wnck_keyboard_move (Screen *screen,
   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_WM_MOVERESIZE");
   xev.xclient.format = 32;
@@ -880,6 +876,7 @@ _wnck_keyboard_move (Screen *screen,
   xev.xclient.data.l[1] = 0; /* unused */
   xev.xclient.data.l[2] = _NET_WM_MOVERESIZE_MOVE_KEYBOARD;
   xev.xclient.data.l[3] = 0; /* unused */
+  xev.xclient.data.l[4] = 0;
 
   XSendEvent (gdk_display,
               RootWindowOfScreen (screen),
@@ -895,9 +892,6 @@ _wnck_keyboard_size (Screen *screen,
   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_WM_MOVERESIZE");
   xev.xclient.format = 32;
@@ -905,6 +899,7 @@ _wnck_keyboard_size (Screen *screen,
   xev.xclient.data.l[1] = 0; /* unused */
   xev.xclient.data.l[2] = _NET_WM_MOVERESIZE_SIZE_KEYBOARD;
   xev.xclient.data.l[3] = 0; /* unused */
+  xev.xclient.data.l[4] = 0;
 
   XSendEvent (gdk_display,
               RootWindowOfScreen (screen),
@@ -927,15 +922,14 @@ _wnck_change_state (Screen  *screen,
 #define _NET_WM_STATE_TOGGLE        2    /* toggle property  */  
   
   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_WM_STATE");
   xev.xclient.format = 32;
   xev.xclient.data.l[0] = add ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
   xev.xclient.data.l[1] = state1;
   xev.xclient.data.l[2] = state2;
+  xev.xclient.data.l[3] = 0;
+  xev.xclient.data.l[4] = 0;
 
   XSendEvent (gdk_display,
 	      RootWindowOfScreen (screen),
@@ -952,15 +946,14 @@ _wnck_change_workspace (Screen     *scre
   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_WM_DESKTOP");
   xev.xclient.format = 32;
   xev.xclient.data.l[0] = new_space;
   xev.xclient.data.l[1] = 0;
   xev.xclient.data.l[2] = 0;
+  xev.xclient.data.l[3] = 0;
+  xev.xclient.data.l[4] = 0;
 
   XSendEvent (gdk_display,
 	      RootWindowOfScreen (screen),
@@ -971,20 +964,20 @@ _wnck_change_workspace (Screen     *scre
 
 void
 _wnck_activate (Screen *screen,
-		Window  xwindow)
+		Window  xwindow,
+		Time    timestamp)
 {
   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_ACTIVE_WINDOW");
   xev.xclient.format = 32;
-  xev.xclient.data.l[0] = 0;
-  xev.xclient.data.l[1] = 0;
+  xev.xclient.data.l[0] = 2; /* source indication */
+  xev.xclient.data.l[1] = timestamp;
   xev.xclient.data.l[2] = 0;
+  xev.xclient.data.l[3] = 0;
+  xev.xclient.data.l[4] = 0;
 
   XSendEvent (gdk_display,
 	      RootWindowOfScreen (screen),
@@ -1000,15 +993,14 @@ _wnck_activate_workspace (Screen *screen
   XEvent xev;
   
   xev.xclient.type = ClientMessage;
-  xev.xclient.serial = 0;
-  xev.xclient.send_event = True;
-  xev.xclient.display = gdk_display;
   xev.xclient.window = RootWindowOfScreen (screen);
   xev.xclient.message_type = _wnck_atom_get ("_NET_CURRENT_DESKTOP");
   xev.xclient.format = 32;
   xev.xclient.data.l[0] = new_active_space;
   xev.xclient.data.l[1] = 0;
   xev.xclient.data.l[2] = 0;
+  xev.xclient.data.l[3] = 0;
+  xev.xclient.data.l[4] = 0;
 
   XSendEvent (gdk_display,
 	      RootWindowOfScreen (screen),
@@ -1025,15 +1017,14 @@ _wnck_change_viewport (Screen *screen,
   XEvent xev;
   
   xev.xclient.type = ClientMessage;
-  xev.xclient.serial = 0;
-  xev.xclient.send_event = True;
-  xev.xclient.display = gdk_display;
   xev.xclient.window = RootWindowOfScreen (screen);
   xev.xclient.message_type = _wnck_atom_get ("_NET_DESKTOP_VIEWPORT");
   xev.xclient.format = 32;
   xev.xclient.data.l[0] = x;
   xev.xclient.data.l[1] = y;
   xev.xclient.data.l[2] = 0;
+  xev.xclient.data.l[3] = 0;
+  xev.xclient.data.l[4] = 0;
 
   XSendEvent (gdk_display,
 	      RootWindowOfScreen (screen),
@@ -1049,15 +1040,14 @@ _wnck_toggle_showing_desktop (Screen  *s
   XEvent xev;
   
   xev.xclient.type = ClientMessage;
-  xev.xclient.serial = 0;
-  xev.xclient.send_event = True;
-  xev.xclient.display = DisplayOfScreen (screen);
   xev.xclient.window = RootWindowOfScreen (screen);
   xev.xclient.message_type = _wnck_atom_get ("_NET_SHOWING_DESKTOP");
   xev.xclient.format = 32;
   xev.xclient.data.l[0] = show != FALSE;
   xev.xclient.data.l[1] = 0;
   xev.xclient.data.l[2] = 0;
+  xev.xclient.data.l[3] = 0;
+  xev.xclient.data.l[4] = 0;
 
   XSendEvent (DisplayOfScreen (screen),
 	      RootWindowOfScreen (screen),
Index: libwnck/xutils.h
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/xutils.h,v
retrieving revision 1.23
diff -p -u -r1.23 xutils.h
--- libwnck/xutils.h	4 Apr 2003 06:50:10 -0000	1.23
+++ libwnck/xutils.h	2 Mar 2004 00:56:00 -0000
@@ -99,7 +99,8 @@ void _wnck_change_workspace (Screen  *sc
 			     Window   xwindow,
                              int      new_space);
 void _wnck_activate         (Screen  *screen,
-			     Window   xwindow);
+			     Window   xwindow,
+			     Time     timestamp);
 void _wnck_activate_workspace (Screen *screen,
 			       int     new_active_space);
 void _wnck_change_viewport (Screen *screen,
