diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2007-10-13 19:47:48 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2007-10-13 19:47:48 +0800 |
commit | 0ab84cc3ffe6129ae40ad436eb62fccbd52b00ad (patch) | |
tree | e3b4078a2ee06cd777a50399771a2fca7263898d /libempathy-gtk/empathy-chat-window.c | |
parent | b4b1a54e84d210404ebc0f6c3e80622bc277ebc0 (diff) | |
download | gsoc2013-empathy-0ab84cc3ffe6129ae40ad436eb62fccbd52b00ad.tar gsoc2013-empathy-0ab84cc3ffe6129ae40ad436eb62fccbd52b00ad.tar.gz gsoc2013-empathy-0ab84cc3ffe6129ae40ad436eb62fccbd52b00ad.tar.bz2 gsoc2013-empathy-0ab84cc3ffe6129ae40ad436eb62fccbd52b00ad.tar.lz gsoc2013-empathy-0ab84cc3ffe6129ae40ad436eb62fccbd52b00ad.tar.xz gsoc2013-empathy-0ab84cc3ffe6129ae40ad436eb62fccbd52b00ad.tar.zst gsoc2013-empathy-0ab84cc3ffe6129ae40ad436eb62fccbd52b00ad.zip |
Use g_timeout_add_seconds when appropriated to avoid weaking the process
2007-10-13 Xavier Claessens <xclaesse@gmail.com>
* libempathy-gtk/empathy-main-window.c:
* libempathy-gtk/empathy-presence-chooser.c:
* libempathy-gtk/empathy-contact-list-view.c:
* libempathy-gtk/empathy-contact-widget.c:
* libempathy-gtk/empathy-chat.c:
* libempathy-gtk/empathy-contact-list-store.c:
* libempathy-gtk/empathy-chat-window.c:
* libempathy/empathy-idle.c:
* tests/contact-manager.c: Use g_timeout_add_seconds when appropriated
to avoid weaking the process too much.
svn path=/trunk/; revision=370
Diffstat (limited to 'libempathy-gtk/empathy-chat-window.c')
-rw-r--r-- | libempathy-gtk/empathy-chat-window.c | 55 |
1 files changed, 6 insertions, 49 deletions
diff --git a/libempathy-gtk/empathy-chat-window.c b/libempathy-gtk/empathy-chat-window.c index 6535500de..54e896263 100644 --- a/libempathy-gtk/empathy-chat-window.c +++ b/libempathy-gtk/empathy-chat-window.c @@ -60,8 +60,6 @@ #define DEBUG_DOMAIN "ChatWindow" -#define URGENCY_TIMEOUT 60*1000 - struct _EmpathyChatWindowPriv { EmpathyChatroomManager *chatroom_manager; GList *chats; @@ -73,8 +71,6 @@ struct _EmpathyChatWindowPriv { gboolean page_added; gboolean dnd_same_window; - guint urgency_timeout_id; - GtkWidget *dialog; GtkWidget *notebook; @@ -510,10 +506,6 @@ empathy_chat_window_finalize (GObject *object) g_source_remove (priv->save_geometry_id); } - if (priv->urgency_timeout_id != 0) { - g_source_remove (priv->urgency_timeout_id); - } - chat_windows = g_list_remove (chat_windows, window); gtk_widget_destroy (priv->dialog); g_object_unref (priv->tooltips); @@ -954,9 +946,9 @@ chat_window_configure_event_cb (GtkWidget *widget, } priv->save_geometry_id = - g_timeout_add (500, - (GSourceFunc) chat_window_save_geometry_timeout_cb, - window); + g_timeout_add_seconds (1, + (GSourceFunc) chat_window_save_geometry_timeout_cb, + window); return FALSE; } @@ -1690,21 +1682,6 @@ chat_window_drag_data_received (GtkWidget *widget, } } -static gboolean -chat_window_urgency_timeout_func (EmpathyChatWindow *window) -{ - EmpathyChatWindowPriv *priv; - - priv = GET_PRIV (window); - - empathy_debug (DEBUG_DOMAIN, "Turning off urgency hint"); - gtk_window_set_urgency_hint (GTK_WINDOW (priv->dialog), FALSE); - - priv->urgency_timeout_id = 0; - - return FALSE; -} - static void chat_window_set_urgency_hint (EmpathyChatWindow *window, gboolean urgent) @@ -1713,29 +1690,9 @@ chat_window_set_urgency_hint (EmpathyChatWindow *window, priv = GET_PRIV (window); - if (!urgent) { - /* Remove any existing hint and timeout. */ - if (priv->urgency_timeout_id) { - empathy_debug (DEBUG_DOMAIN, "Turning off urgency hint"); - gtk_window_set_urgency_hint (GTK_WINDOW (priv->dialog), FALSE); - g_source_remove (priv->urgency_timeout_id); - priv->urgency_timeout_id = 0; - } - return; - } - - /* Add a new hint and renew any exising timeout or add a new one. */ - if (priv->urgency_timeout_id) { - g_source_remove (priv->urgency_timeout_id); - } else { - empathy_debug (DEBUG_DOMAIN, "Turning on urgency hint"); - gtk_window_set_urgency_hint (GTK_WINDOW (priv->dialog), TRUE); - } - - priv->urgency_timeout_id = g_timeout_add ( - URGENCY_TIMEOUT, - (GSourceFunc) chat_window_urgency_timeout_func, - window); + empathy_debug (DEBUG_DOMAIN, "Turning %s urgency hint", + urgent ? "on" : "off"); + gtk_window_set_urgency_hint (GTK_WINDOW (priv->dialog), urgent); } EmpathyChatWindow * |