After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 586133 - don't autoscroll on new messages
don't autoscroll on new messages
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Chat
2.27.x
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
Depends on:
Blocks:
 
 
Reported: 2009-06-17 14:04 UTC by Nicolò Chieffo
Modified: 2009-06-23 15:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
scroll-well-normal-themes.patch (593 bytes, patch)
2009-06-17 20:49 UTC, Nicolò Chieffo
needs-work Details | Review
scroll-well-adium-and-normal-themes.patch (2.44 KB, patch)
2009-06-18 08:22 UTC, Nicolò Chieffo
rejected Details | Review
scroll-well-normal-themes.patch (596 bytes, patch)
2009-06-18 13:47 UTC, Nicolò Chieffo
committed Details | Review

Description Nicolò Chieffo 2009-06-17 14:04:34 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
Comment 1 Nicolò Chieffo 2009-06-17 18:00:45 UTC
This is an adium theme problem. normal themes behave correctly
Comment 2 Nicolò Chieffo 2009-06-17 20:03:30 UTC
Sorry, the bug is also present in normal themes, but randomly it disappears, so I concluded that it was not. 
Comment 3 Nicolò Chieffo 2009-06-17 20:45:59 UTC
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)
Comment 4 Nicolò Chieffo 2009-06-17 20:49:49 UTC
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
Comment 5 Nicolò Chieffo 2009-06-18 08:22:31 UTC
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?
Comment 6 Nicolò Chieffo 2009-06-18 08:39:00 UTC
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.
Comment 7 Pierre-Luc Beaudoin 2009-06-18 13:45:40 UTC
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.
Comment 8 Nicolò Chieffo 2009-06-18 13:47:51 UTC
Created attachment 136921 [details] [review]
scroll-well-normal-themes.patch
Comment 9 Nicolò Chieffo 2009-06-23 08:38:12 UTC
this patch should conform, is it possible to commit it?
Comment 10 Pierre-Luc Beaudoin 2009-06-23 15:18:43 UTC
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.