GNOME Bugzilla – Bug 586133
don't autoscroll on new messages
Last modified: 2009-06-23 15:18:43 UTC
I've noticed that the chat window autoscrolls on new messages. This is a problem if you are reading previous messages: you will be scrolled to the last message automatically, without the possibility to go back where you stopped reading. and if the other contact keeps writing (for example an IRC channle) there's no possibility to read previous messages
This is an adium theme problem. normal themes behave correctly
Sorry, the bug is also present in normal themes, but randomly it disappears, so I concluded that it was not.
There's a strange way (in normal themes) to see if the page is scrolled down or not, and so to decide if it must be scrolled again if (vadj->value + vadj->page_size / 2 < vadj->upper - vadj->page_size) { return FALSE; } [...] return TRUE; If the return value is TRUE when a message is received the page is scrolled down. In my opinion it should be scrolled down only if the adjustment is at the bottom, that is: if (gtk_adjustment_get_value(vadj) < gtk_adjustment_get_upper(vadj) - gtk_adjustment_get_page_size(vadj)) the first part of the bug is fixed (I will attach a patch as soon as I fix the adium part too)
Created attachment 136869 [details] [review] scroll-well-normal-themes.patch It's worth to attach it now. the adium theme will be difficult I think
Created attachment 136906 [details] [review] scroll-well-adium-and-normal-themes.patch I copied the scrolling functions from normal themes, but there's an additional problem. Some adium themes actually defines in the javascript function "appendMessage" or "appendNextMessage" their own implementation of automatic scroll to bottom. Is it possible to disable javascript functions from within empathy?
I've just read the adium spec: "appendMessage" and "appendNextMessage" need to automatically scroll. so this bug can be closed applying the first patch. If autoscrolling is always present it's the theme's fault and it needs to be fixed.
I suspected as much from the Adium themes, it is a design flaw in themes. I doubt they were ever make for huge MUCs (such as IRC). As for the patch, it doesn't conform to our coding styles. Try running make check, it should tell you what's wrong.
Created attachment 136921 [details] [review] scroll-well-normal-themes.patch
this patch should conform, is it possible to commit it?
I confirm that this patch works. It's only problem was that it was not wrapped at 80 chars, so added vars to make it fit. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.