commit fbeb5fbca082717badd9d7e41007c557557a8106
Author: Ken VanDine <ken.vandine@canonical.com>
Date:   Mon Apr 11 10:53:30 2011 -0400

    Really raise the chat window

diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 89c6c09..b76745c 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -1582,6 +1582,41 @@ empathy_window_iconify (GtkWindow *window, GtkStatusIcon *status_icon)
 	gtk_window_iconify (window);
 }
 
+/* Really raise the window, even if the window manager doesn't agree */
+static void
+really_activate_window (GtkWindow *window)
+{
+        Screen *screen;
+        Time    timestamp;
+        XEvent  xev;
+
+        g_return_if_fail (GTK_IS_WINDOW (window));
+
+        screen = GDK_SCREEN_XSCREEN (gtk_widget_get_screen (GTK_WIDGET (window)));
+        timestamp = GDK_CURRENT_TIME;
+
+        xev.xclient.type = ClientMessage;
+        xev.xclient.serial = 0;
+        xev.xclient.send_event = True;
+        xev.xclient.display = GDK_DISPLAY ();
+        xev.xclient.window = GDK_WINDOW_XWINDOW (GTK_WIDGET (window)->window);
+        xev.xclient.message_type = gdk_x11_get_xatom_by_name ("_NET_ACTIVE_WINDOW");
+        xev.xclient.format = 32;
+        xev.xclient.data.l[0] = 2; /* Pager client type */
+        xev.xclient.data.l[1] = timestamp;
+        xev.xclient.data.l[2] = 0;
+        xev.xclient.data.l[3] = 0;
+        xev.xclient.data.l[4] = 0;
+
+        gdk_error_trap_push ();
+        XSendEvent (GDK_DISPLAY (),
+                RootWindowOfScreen (screen),
+                False,
+                SubstructureRedirectMask | SubstructureNotifyMask,
+                &xev);
+        gdk_error_trap_pop ();
+}
+
 /* Takes care of moving the window to the current workspace. */
 void
 empathy_window_present_with_time (GtkWindow *window,
@@ -1616,6 +1651,7 @@ empathy_window_present_with_time (GtkWindow *window,
 
 	gtk_window_set_skip_taskbar_hint (window, FALSE);
 	gtk_window_deiconify (window);
+	really_activate_window (window);
 }
 
 void
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index 342d3e1..ac9897c 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -43,6 +43,8 @@
 #include <libempathy-gtk/empathy-images.h>
 #include <libempathy-gtk/empathy-contact-dialogs.h>
 #include <libempathy-gtk/empathy-sound-manager.h>
+#include <libempathy-gtk/empathy-ui-utils.h>
+
 
 #include "empathy-event-manager.h"
 #include "empathy-main-window.h"
@@ -494,7 +496,7 @@ event_channel_process_voip_func (EventPriv *event)
 
   if (event->approval->dialog != NULL)
     {
-      gtk_window_present (GTK_WINDOW (event->approval->dialog));
+      empathy_window_present (GTK_WINDOW (event->approval->dialog));
       return;
     }
 
