aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-04-25 00:39:39 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-04-25 02:44:09 +0800
commitc633b9b25a6bd729b8441382332e807d31331a93 (patch)
treeeed9e8127a79238bcc3eee06336d7d33e38d145d
parent14eab5e164f0078f7d0bfbd580b8ecd19e61d72f (diff)
downloadgsoc2013-empathy-c633b9b25a6bd729b8441382332e807d31331a93.tar
gsoc2013-empathy-c633b9b25a6bd729b8441382332e807d31331a93.tar.gz
gsoc2013-empathy-c633b9b25a6bd729b8441382332e807d31331a93.tar.bz2
gsoc2013-empathy-c633b9b25a6bd729b8441382332e807d31331a93.tar.lz
gsoc2013-empathy-c633b9b25a6bd729b8441382332e807d31331a93.tar.xz
gsoc2013-empathy-c633b9b25a6bd729b8441382332e807d31331a93.tar.zst
gsoc2013-empathy-c633b9b25a6bd729b8441382332e807d31331a93.zip
Pass the ChannelDispatcher timestamp onwards to window_present
-rw-r--r--libempathy-gtk/empathy-ui-utils.c10
-rw-r--r--libempathy-gtk/empathy-ui-utils.h4
-rw-r--r--src/empathy-chat-window.c9
3 files changed, 19 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 3f37ea2db..70098ad3e 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -1392,10 +1392,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)
+empathy_window_present_with_time (GtkWindow *window,
+ guint32 timestamp)
{
GdkWindow *gdk_window;
- guint32 timestamp;
g_return_if_fail (GTK_IS_WINDOW (window));
@@ -1436,6 +1436,12 @@ empathy_window_present (GtkWindow *window)
gtk_window_deiconify (window);
}
+void
+empathy_window_present (GtkWindow *window)
+{
+ empathy_window_present_with_time (window, GDK_CURRENT_TIME);
+}
+
GtkWindow *
empathy_get_toplevel_window (GtkWidget *widget)
{
diff --git a/libempathy-gtk/empathy-ui-utils.h b/libempathy-gtk/empathy-ui-utils.h
index 8834cb4c9..6dab13789 100644
--- a/libempathy-gtk/empathy-ui-utils.h
+++ b/libempathy-gtk/empathy-ui-utils.h
@@ -104,7 +104,9 @@ gboolean empathy_text_iter_backward_search (const GtkTextIter*iter,
const GtkTextIter*limit);
/* Windows */
gboolean empathy_window_get_is_visible (GtkWindow *window);
-void empathy_window_present (GtkWindow *window);
+void empathy_window_present (GtkWindow *window);
+void empathy_window_present_with_time (GtkWindow *window,
+ guint32 timestamp);
void empathy_window_iconify (GtkWindow *window,
GtkStatusIcon *status_icon);
GtkWindow * empathy_get_toplevel_window (GtkWidget *widget);
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index bdd80ea5e..ca569e11d 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -2288,9 +2288,16 @@ empathy_chat_window_present_chat (EmpathyChat *chat,
empathy_chat_window_add_chat (window, chat);
}
+ /* Don't force the window to show itself when it wasn't
+ * an action by the user
+ */
+ if (timestamp == EMPATHY_DISPATCHER_NON_USER_ACTION)
+ return;
+
priv = GET_PRIV (window);
empathy_chat_window_switch_to_chat (window, chat);
- empathy_window_present (GTK_WINDOW (priv->dialog));
+ empathy_window_present_with_time (GTK_WINDOW (priv->dialog),
+ CLAMP (timestamp, 0, G_MAXUINT32));
gtk_widget_grab_focus (chat->input_text_view);
}