[empathy] Fix Bug 586133: don't autoscroll on new messages
- From: Pierre-Luc Beaudoin <plbeaudoin src gnome org>
- To: svn-commits-list gnome org
- Subject: [empathy] Fix Bug 586133: don't autoscroll on new messages
- Date: Tue, 23 Jun 2009 11:17:09 -0400 (EDT)
commit f18e71dedebf24c9cb721c1cf7ce5f7009324b3b
Author: Nicolò Chieffo <nicolo chieffo gmail com>
Date: Tue Jun 23 11:13:55 2009 -0400
Fix Bug 586133: don't autoscroll on new messages
libempathy-gtk/empathy-chat-text-view.c | 12 +++++++++---
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 95e67b7..a33b6a9 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;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]