GNOME Bugzilla – Bug 721480
[regression] 3.8->3.10 scrolled window is empty
Last modified: 2014-01-08 10:23:06 UTC
When I run just "./s" it works fine, no scrollbars: When I run "./s 500" then automatic scrollbars work on Fedora 19: But the same run "./s 500" no longer works on Fedora 20, no lines get drawn anymore.
Created attachment 265338 [details] .c reproducer
Created attachment 265339 [details] ./s: no scrolling - everything OK
Created attachment 265340 [details] ./s 500: correctly scrolling on gtk3-3.8.8-2.fc19
Created attachment 265341 [details] ./s 500: failed/empty window on gtk3-3.10.6-1.fc20
gtk3-3.11.2-1.fc21 still/also FAILs.
2df27ce7f801da92e64ed966d96c47e3f5d190e7 is the first bad commit commit 2df27ce7f801da92e64ed966d96c47e3f5d190e7 Author: Alexander Larsson <alexl@redhat.com> Date: Sun Apr 21 01:54:05 2013 +0200 Make GtkViewport use GtkPixelCache Since gdk_window_move() no longer uses XCopyArea all scrolling now re-renders everything in the window. To get performance back we use a GtkPixelCache to store already drawn children, and we when we expose the viewport we just blit the offscreen to the right place. = 3.9.0 -> 3.9.2 At least I hope my application code is correct.
Today's commit cc6ffd0481e15659d6ec6758fa4e457a307f3137 still has the bug.
The difference between the two cases is that you're getting a different default color. If you add cairo_set_source_rgb(cr, 0, 0, 0); to set a black color then both cases work. Its kinda bad that this changes between these cases though, i see no reason for that, as most code does cairo_save/restore() calls around rendering, and the initial color of a cairo_t is indeed black.
Created attachment 265679 [details] [review] PixelCache: Ensure clean cairo_t state in draw This adds save/restore calls to the clear-to-transparent call in the pixel cache, to avoid changing the default color of the cairo_t. It also removes a call set_operator call that is no longer necessary (it was trying to manually restore the state).
Attachment 265679 [details] pushed as d079138 - PixelCache: Ensure clean cairo_t state in draw
You are right about my forgotten cr->set_source_rgb() and thanks for the fix.