Index: gdk/x11/gdkwindow-x11.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/x11/gdkwindow-x11.c,v
retrieving revision 1.205.2.2
diff -p -u -r1.205.2.2 gdkwindow-x11.c
--- gdk/x11/gdkwindow-x11.c	7 Jul 2004 03:02:01 -0000	1.205.2.2
+++ gdk/x11/gdkwindow-x11.c	19 Aug 2004 00:29:53 -0000
@@ -1722,9 +1722,9 @@ gdk_window_focus (GdkWindow *window,
       xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display,
 									"_NET_ACTIVE_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[0] = 1; /* requestor type; we're an app */
+      xev.xclient.data.l[1] = timestamp;
+      xev.xclient.data.l[2] = GDK_WINDOW_XID (window);
       xev.xclient.data.l[3] = 0;
       xev.xclient.data.l[4] = 0;
       
Index: gtk/gtkwindow.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkwindow.c,v
retrieving revision 1.264.2.3
diff -p -u -r1.264.2.3 gtkwindow.c
--- gtk/gtkwindow.c	4 Jul 2004 03:48:28 -0000	1.264.2.3
+++ gtk/gtkwindow.c	19 Aug 2004 00:29:53 -0000
@@ -5713,17 +5713,18 @@ gtk_window_present (GtkWindow *window)
       g_assert (widget->window != NULL);
       
       gdk_window_show (widget->window);
-
-      /* note that gdk_window_focus() will also move the window to
-       * the current desktop, for WM spec compliant window managers.
-       */
-      gdk_window_focus (widget->window,
-                        gtk_get_current_event_time ());
     }
   else
     {
       gtk_widget_show (widget);
     }
+
+  /* note that gdk_window_focus() will also move the window to
+   * the current desktop, for WM spec compliant window managers.
+   */
+  gdk_window_focus (widget->window,
+                    gtk_get_current_event_time ());
+
 }
 
 /**
