aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorNicolò Chieffo <nicolo.chieffo@gmail.com>2009-06-23 23:13:55 +0800
committerPierre-Luc Beaudoin <pierre-luc.beaudoin@collabora.co.uk>2009-06-23 23:15:31 +0800
commitf18e71dedebf24c9cb721c1cf7ce5f7009324b3b (patch)
treeb37b544ee18680de107daf78df81b80ec4e59fa0 /libempathy-gtk
parent03fa531203802810a57bc723132368bf2761e19c (diff)
downloadgsoc2013-empathy-f18e71dedebf24c9cb721c1cf7ce5f7009324b3b.tar
gsoc2013-empathy-f18e71dedebf24c9cb721c1cf7ce5f7009324b3b.tar.gz
gsoc2013-empathy-f18e71dedebf24c9cb721c1cf7ce5f7009324b3b.tar.bz2
gsoc2013-empathy-f18e71dedebf24c9cb721c1cf7ce5f7009324b3b.tar.lz
gsoc2013-empathy-f18e71dedebf24c9cb721c1cf7ce5f7009324b3b.tar.xz
gsoc2013-empathy-f18e71dedebf24c9cb721c1cf7ce5f7009324b3b.tar.zst
gsoc2013-empathy-f18e71dedebf24c9cb721c1cf7ce5f7009324b3b.zip
Fix Bug 586133: don't autoscroll on new messages
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-chat-text-view.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-chat-text-view.c b/libempathy-gtk/empathy-chat-text-view.c
index 95e67b714..a33b6a9fe 100644
--- a/libempathy-gtk/empathy-chat-text-view.c
+++ b/libempathy-gtk/empathy-chat-text-view.c
@@ -336,10 +336,16 @@ chat_text_view_is_scrolled_down (EmpathyChatTextView *view)
sw = gtk_widget_get_parent (GTK_WIDGET (view));
if (GTK_IS_SCROLLED_WINDOW (sw)) {
GtkAdjustment *vadj;
-
+ gdouble value;
+ gdouble upper;
+ gdouble page_size;
+
vadj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (sw));
-
- if (vadj->value + vadj->page_size / 2 < vadj->upper - vadj->page_size) {
+ value = gtk_adjustment_get_value (vadj);
+ upper = gtk_adjustment_get_upper (vadj);
+ page_size = gtk_adjustment_get_page_size (vadj);
+
+ if (value < upper - page_size) {
return FALSE;
}
}