]> 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 4b0f4a404a156285c07b3a81d52bcf611979eef0..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);
 }
@@ -1631,6 +1636,9 @@ empathy_send_file_with_file_chooser (EmpathyContact *contact)
 
        gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (widget), FALSE);
 
+       gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (widget),
+               g_get_home_dir ());
+
        g_signal_connect (widget, "response",
                          G_CALLBACK (file_manager_send_file_response_cb),
                          contact);