]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-ui-utils.c
empathy_window_present: use _NET_WM_USER_TIME only has a fallback
[empathy.git] / libempathy-gtk / empathy-ui-utils.c
index b33760629433a67b1e26133ebb87e47a4dee1ba7..4503a39cc22f67f12cb613e3d1be4f55df183d46 100644 (file)
@@ -1385,10 +1385,10 @@ empathy_window_iconify (GtkWindow *window, GtkStatusIcon *status_icon)
 
 /* Takes care of moving the window to the current workspace. */
 void
-empathy_window_present (GtkWindow *window,
-                       gboolean   steal_focus)
+empathy_window_present (GtkWindow *window)
 {
        GdkWindow *gdk_window;
+       guint32 timestamp;
 
        g_return_if_fail (GTK_IS_WINDOW (window));
 
@@ -1410,7 +1410,12 @@ empathy_window_present (GtkWindow *window,
                        gtk_widget_hide (GTK_WIDGET (window));
        }
 
-       gtk_window_present_with_time (window, G_MAXINT32);
+       timestamp = gtk_get_current_event_time ();
+       if (timestamp == 0)
+               /* No event, fallback to _NET_WM_USER_TIME */
+               timestamp = gdk_x11_display_get_user_time (gdk_display_get_default ());
+
+       gtk_window_present_with_time (window, timestamp);
        gtk_window_set_skip_taskbar_hint (window, FALSE);
        gtk_window_deiconify (window);
 }