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 763741 - Wavy/squiggly underline not properly removed
Wavy/squiggly underline not properly removed
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
3.22.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-03-16 10:48 UTC by Sébastien Wilmet
Modified: 2018-04-15 00:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Benjamin's patch (2.96 KB, patch)
2016-03-16 11:00 UTC, Matthias Clasen
accepted-commit_after_freeze Details | Review
textview: Track differences between ink and logical rects (3.03 KB, patch)
2016-03-16 14:58 UTC, Benjamin Otte (Company)
none Details | Review
textview: Track differences between ink and logical rects (5.35 KB, patch)
2016-03-16 17:10 UTC, Benjamin Otte (Company)
committed Details | Review
gtk-demo: Improve markup demo (5.81 KB, patch)
2016-03-16 18:07 UTC, Matthias Clasen
committed Details | Review

Description Sébastien Wilmet 2016-03-16 10:48:29 UTC
1. Have a GtkTextTag with the 'underline' property set to PANGO_UNDERLINE_ERROR.
2. Apply the tag to some visible text.
3. Remove the tag.

-> the wavy/squiggly underline is not properly removed, there are some remaining red dots at the bottom. The redraw seems to be one pixel too short on the vertical side.

See attachment 156044 [details] for a screenshot.
Comment 1 Sébastien Wilmet 2016-03-16 10:55:39 UTC
Bug #103662 is related, see Owen's comment:
https://bugzilla.gnome.org/show_bug.cgi?id=103662#c12
Comment 2 Matthias Clasen 2016-03-16 11:00:29 UTC
Created attachment 324086 [details] [review]
Benjamin's patch
Comment 3 Benjamin Otte (Company) 2016-03-16 14:58:36 UTC
Created attachment 324106 [details] [review]
textview: Track differences between ink and logical rects

This way, we can ensure that we queue redraws on the full ink rect. This
is particularly visible for squiggly underlines in spell checking.
Comment 4 Sébastien Wilmet 2016-03-16 15:28:47 UTC
Review of attachment 324106 [details] [review]:

With the patch applied, I can still see the bug in gedit.
Comment 5 Matthias Clasen 2016-03-16 16:55:56 UTC
Review of attachment 324106 [details] [review]:

::: gtk/gtktextbtree.c
@@ +2656,3 @@
       ld = _gtk_text_line_get_data (end_line, view->view_id);
       if (ld)
+        end_y += ld->height + ld->bottom_ink;

Don't you need a top_ink here as well ?
Comment 6 Benjamin Otte (Company) 2016-03-16 17:10:01 UTC
Created attachment 324121 [details] [review]
textview: Track differences between ink and logical rects

This way, we can ensure that we queue redraws on the full ink rect. This
is particularly visible for squiggly underlines in spell checking.
Comment 7 Matthias Clasen 2016-03-16 18:07:08 UTC
Created attachment 324123 [details] [review]
gtk-demo: Improve markup demo

Add squiggly underlines and background, and make the markup editable.
Comment 8 Matthias Clasen 2016-03-16 18:13:32 UTC
Review of attachment 324123 [details] [review]:

::: demos/gtk-demo/markup.c
@@ +30,3 @@
+      buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
+      gtk_text_buffer_get_start_iter (buffer, &start);
+      gtk_text_buffer_insert_markup (buffer, &start, markup, -1);

Need to clear the buffer first, here

@@ +97,3 @@
+      gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
+                                      GTK_POLICY_NEVER,
+                                      GTK_POLICY_AUTOMATIC);

Should allow horizontal scrolling
Comment 9 Matthias Clasen 2016-03-21 01:58:31 UTC
Review of attachment 324121 [details] [review]:

.
Comment 10 Matthias Clasen 2016-03-21 17:38:56 UTC
Attachment 324121 [details] pushed as 45dfdbc - textview: Track differences between ink and logical rects
Attachment 324123 [details] pushed as 73fe852 - gtk-demo: Improve markup demo
Comment 11 Sébastien Wilmet 2017-07-22 11:53:43 UTC
Some commits have been pushed, but the bug is not fully fixed. If I recall correctly the discussion on IRC with Company, words with some specific letters still trigger the bug.
Comment 12 Daniel Boles 2018-04-02 09:11:50 UTC
Does anyone have a usable example of that?
Comment 13 Sébastien Wilmet 2018-04-02 10:43:01 UTC
I doubt the problem has been fixed by itself, at least in GTK+ 3.
Comment 14 Daniel Boles 2018-04-02 10:47:35 UTC
What I meant was that the description in Comment 11 seems too vague for anyone else to understand/investigate, so unless you or Benjamin have a fix in mind, other readers probably need specific steps to replicate it.
Comment 15 Sébastien Wilmet 2018-04-02 15:51:33 UTC
More testing is needed, but I recall correctly that after Benjamin's patches have been pushed, the problem was still not fixed entirely because I still had the bug in gedit with gspell.

Since then I've modified gspell to insert a PANGO_UNDERLINE_SINGLE instead of PANGO_UNDERLINE_ERROR to workaround the bug (it's not that bad because Android also has a single underline, although thicker).
Comment 16 Matthias Clasen 2018-04-15 00:15:36 UTC
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla.

If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab:

https://gitlab.gnome.org/GNOME/gtk/issues/new