GNOME Bugzilla – Bug 753815
scroll fix with margin/padding
Last modified: 2015-09-02 02:48:54 UTC
Created attachment 309566 [details] [review] fix scroll behaviour expected behaviour: When you move line by line, only padding is automatically shown and you need to use Page key to show margin. This fix cursor going out of the screen bug too. There still some pixelcache prob, i need to check Christian for this. this fix is a follow up to : https://bugzilla.gnome.org/show_bug.cgi?id=406159
Review of attachment 309566 [details] [review]: ok
Review of attachment 309566 [details] [review]: commited as 8baab8f
I keep the report opened to fix the scroll prob
*** Bug 754147 has been marked as a duplicate of this bug. ***
Created attachment 310237 [details] [review] GtkTextView: various scroll fixes Due to the introduction of view's margin and padding, some bugs in scrolling behaviour have come. This commit fix them.
I tested a GTK+ built with both slaf's patches (the one already merged, and the one from #c5) and it looks OK for me (solves the issue with gedit jumping around a lot).
Review of attachment 310237 [details] [review]: I haven't tested this in detail, mainly because the commit message doesn't actually describe the bugs in enough detail to verify. It would be good if it described both the scrolling behaviour you are trying to achieve here, and in what way the code was failing to implement it.
mclasen: the code as merged has a clear and annoying bug: https://bugzilla.gnome.org/show_bug.cgi?id=754147 which causes gedit to keep jumping the line you're editing to the bottom of the window. This fixes that, at least.
Attachment 310237 [details] pushed as 016f659 - GtkTextView: various scroll fixes
sorry, didn't mean to push this yet
if you add some of the symptom descriptions from that gedit bug in the commit message, that would be great
hi, Here is a list of fixed symptom seen before this patch: Padding not displayed correctly when moving cursor at beginning/end of lines One pixel shift in x or y in some rendered bottom text ( fixed by converting adjustment float values to integer before the calculation ) Some horizontal jumps forward and backward when using Page right key at the end of the longest line. retval return value of _gtk_text_view_scroll_to_iter wrong in some cases
i'll update the commit message of the patch ASAP and will try to be as precise as possible
Created attachment 310438 [details] [review] GtkTextView: various scroll fixes The purpose of this patch is to fix regressions in GtkTextView scroll behaviours due to commit d138156. ( addition of padding and margins to the view ) Adding some padding is done by, for example, in inspector css tab with: GtkTextView { padding: 10px 10px 10px 10px; } and adding margins, by changing one of *-margin properties ( * standing for left/right/top/bottom ) or the corresponding accessor functions. Understand that none of these bugs are easy to trigger. What's happened is that a old and wrong version of the code of the code ( lost in the mean time ) was pushed. These bugs are best seen with wrap mode set to off. The commit 8baab8f fix a first regression. This one is about: - Cursor going out of the view at line ends instead of being visible or triggering the horizontal scroll. - Padding not displayed correctly when moving cursor at beginning/end of lines - When horizontal scroll position not at left, cursor can make scroll by more than one character (you need left padding to see this ) - Moving the cursor arround, the rendered text can be shitted in x or y. ( fixed by converting adjustment float values to integer before calculations ) It can be observed by going down with the cursor more than the view height then going up - retval return value of _gtk_text_view_scroll_to_iter wrong in some cases In addition, this patch re-factor priv->top_border in screen_dest.y calculation Of course, all GtkTextView and GtkSourceView based app were impacted by these bugs ( gedit for example, see bug 754147 ) https://bugzilla.gnome.org/show_bug.cgi?id=753815 https://bugzilla.gnome.org/show_bug.cgi?id=75815
Created attachment 310439 [details] [review] GtkTextView: various scroll fixes The purpose of this patch is to fix regressions in GtkTextView scroll behaviours due to commit d138156. ( addition of padding and margins to the view ) Adding some padding is done by, for example, in inspector css tab with: GtkTextView { padding: 10px 10px 10px 10px; } and adding margins, by changing one of *-margin properties ( * standing for left/right/top/bottom ) or the corresponding accessor functions. Understand that none of these bugs are easy to trigger. What's happened is that a old and wrong version of the code of the code ( lost in the mean time ) was pushed. These bugs are best seen with wrap mode set to off. The commit 8baab8f fix a first regression. This one is about: - Cursor going out of the view at line ends instead of being visible or triggering the horizontal scroll. - Padding not displayed correctly when moving cursor at beginning/end of lines - When horizontal scroll position not at left, cursor can make scroll by more than one character (you need left padding to see this ) - Moving the cursor arround, the rendered text can be shitted in x or y. ( fixed by converting adjustment float values to integer before calculations ) It can be observed by going down with the cursor more than the view height then going up - retval return value of _gtk_text_view_scroll_to_iter wrong in some cases In addition, this patch re-factor priv->top_border in screen_dest.y calculation Of course, all GtkTextView and GtkSourceView based app were impacted by these bugs ( gedit for example, see bug 754147 ) https://bugzilla.gnome.org/show_bug.cgi?id=753815
Attachment 310439 [details] pushed as 9ad6ac0 - GtkTextView: various scroll fixes