GNOME Bugzilla – Bug 537825
Text cursor not erased when moved to new position
Last modified: 2014-10-31 11:34:58 UTC
Please describe the problem: Text cursor image remains on page when text cursor is moved. If the blinking cursor is move by using the up arrow while the cursor is visible, the previous cursor image remains on the page. Does not happen all of the time. Also, small piece of the bottom end of the cursor remains in the line of text when typing. When a redraw event occurs, the old images of the text cursor are erased, until it happens again. Steps to reproduce: 1. Open Evolution. Select "New" message. 2. Single click in the message body to position text cursor at the upper left. Hit "Enter" three times. 3. While the blinking text cursor is visible, hit the up arrow. Blinking text cursor is now on the second line and the image of the old text cursor remains on the third line. Actual results: Image of the old text cursor is not erased. Expected results: The image of the text cursor in the previous position should have been erased. Does this happen every time? NO! But it can happen in both HTML and plain text mode. It always happens using the instructions given. But once a message is being typed the problem may go away for a short period. Other information: It is very annoying but not something that completely cripples the program.
At this point the solution to rendering issues is probably "move to WebKit". GtkHtml's rendering engine isn't really being maintained anymore.
Created attachment 122519 [details] Screenshot This is a screenshot of this effect. It occurs when editing text already entered in a new message when using the arrows.
*** Bug 541593 has been marked as a duplicate of this bug. ***
*** Bug 542009 has been marked as a duplicate of this bug. ***
Created attachment 287974 [details] [review] When repainting, draw the cursor as part of the repaint When we repaint and the cursor is visible, draw the cursor to the main cairo context we are using, rather than separately. This makes sure that we draw the cursor on top of the content and clipped to the redraw area, and thus preserve the shown/hidden state properly. Some combination of redraw ordering or drawing outside the clipped area caused the shown/hidden state of the cursor to be flipped on redraw, causing a left-over cursor on next cursor move.
Review of attachment 287974 [details] [review]: Apart of the two issues looks good, I'll commit a changed version of the patch, even I'm not able to reproduce the issue, somehow. ::: gtkhtml/htmlengine-edit-cursor.c @@ +359,3 @@ if (clip_cursor (engine, x, y, width, height, &x1, &y1, &x2, &y2)) { cairo_t *cr; + gboolean using_painter_cr; can be used uninitialized @@ +375,3 @@ + y2 -= gdk_painter->y1; + } else { + gdk_cairo_get_clip_rectangle (cr, &rect); build breaks on this line (as you pointed out on IRC)
Created commit e8a1711 in gtkhtml master (4.9.1+) [1] Created commit 8d107ad in gtkhtml gnome-3-12 (4.8.5+) [1] https://git.gnome.org/browse/gtkhtml/commit?id=e8a1711
Further investigation reveals that this is a workaround for a bug in either the Xlib backend of cairo or the Intel driver. Running as GDK_RENDERING=image fixes the problem that I was seeing - which may or may not be the same as the original problem. The patch as applied is at least as correct as the original, however, and even a bit more efficient.
*** Bug 734565 has been marked as a duplicate of this bug. ***
Issue persists despite updating to gtkhtml 4.8.5 containing above fix. I see both this issue as well the cursor disappearing issue [bug 734565] happen when composing emails. Versions installed: libgtkhtml-4_0-0 | 4.8.5-1.1 | x86_64 libgtkhtml-editor-4_0-0 | 4.8.5-1.1 | x86_64 evolution | 3.12.6-1.1 | x86_64
Created attachment 289630 [details] Screenshot showing simultaneously visible shadow cursor and real cursor But the real cursor disappears from Line 7 onwards (the shadow cursor remains stuck to the same position.)
What is your gtk3 version, please? This depended on a change in gtk3 too, I think it's part of 3.14.1 or 3.12.1 or something, I do not recall. :(
(In reply to comment #12) > What is your gtk3 version, please? I am on gtk3 3.14.0. I will soon update to 3.14.1 and let you know if that solves it. Thanks for the quick reply.
Thanks a lot, Milan, updated to 3.14.3 and the problem is solved, indeed.
Nice, thanks for the confirmation.