aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-05-11 18:14:53 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-05-11 18:16:26 +0800
commit0a6ce2b0c136c05fa5395d51517208c041bc392d (patch)
tree27340d15c639a9b600c1ce1c452cc9d0e84f396f /libempathy-gtk
parentb850f8c1c6106ac50b26e090c11bd1c7ae8c0f9d (diff)
downloadgsoc2013-empathy-0a6ce2b0c136c05fa5395d51517208c041bc392d.tar
gsoc2013-empathy-0a6ce2b0c136c05fa5395d51517208c041bc392d.tar.gz
gsoc2013-empathy-0a6ce2b0c136c05fa5395d51517208c041bc392d.tar.bz2
gsoc2013-empathy-0a6ce2b0c136c05fa5395d51517208c041bc392d.tar.lz
gsoc2013-empathy-0a6ce2b0c136c05fa5395d51517208c041bc392d.tar.xz
gsoc2013-empathy-0a6ce2b0c136c05fa5395d51517208c041bc392d.tar.zst
gsoc2013-empathy-0a6ce2b0c136c05fa5395d51517208c041bc392d.zip
theme_adium_remove_focus_marks: early return if there is no unread message
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-theme-adium.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index 8c3aec8a0..06410c528 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -571,11 +571,17 @@ theme_adium_append_event_escaped (EmpathyChatView *view,
static void
theme_adium_remove_focus_marks (EmpathyThemeAdium *theme)
{
+ EmpathyThemeAdiumPriv *priv = GET_PRIV (theme);
WebKitDOMDocument *dom;
WebKitDOMNodeList *nodes;
guint i;
GError *error = NULL;
+ if (!priv->has_unread_message)
+ return;
+
+ priv->has_unread_message = FALSE;
+
dom = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (theme));
if (dom == NULL) {
return;
@@ -928,10 +934,7 @@ theme_adium_focus_toggled (EmpathyChatView *view,
EmpathyThemeAdiumPriv *priv = GET_PRIV (view);
priv->has_focus = has_focus;
- if (priv->has_focus) {
- priv->has_unread_message = FALSE;
- }
- else {
+ if (!priv->has_focus) {
theme_adium_remove_focus_marks (self);
}
}