GNOME Bugzilla – Bug 640358
[PATCH] mahjongg: board rendering issues, no double buffering
Last modified: 2011-01-25 02:04:46 UTC
The comment in drawing.c that says we're doing double buffering is no longer correct. Seems to have been broken with the changes to cairo_t for gtk+ 3 in commit aab65121a74d703a639a3fd756797bbe07a1a6fe. The problem is that we're disabling double buffering in gtk+ (see the documentation for gtk_widget_set_double_buffered), which means we need to draw to an offscreen buffer ourselves, but we're directly drawing to the board, so we can get rendering issues (glitches). In any case, doing double buffering ourselves seems kinda silly when we can do normal drawing and relay on gtk+ to do that for us, so the obvious fix is to stop turning off double buffering in the board widget. Screenshot with my rendering issues with git master (which are of course gone when applying my patch) and patch attached.
Created attachment 179115 [details] Rendering issues at the bottom of the board
Created attachment 179116 [details] [review] Don't disable double buffering for the board widget OK to push?
I think the problem may actually be bug 640195 (I haven't tried that GDK yet so can't confirm). Enabling double buffering would just have three buffers...
I've just tried gtk+ from master and you're right! Closing as invalid. I wonder whether it would make sense to use gtk+'s double buffering and just draw directly to it.
The current double buffering in mahjongg is just a straight copy from the existing GTK2 code. I'd also expect drawing directly and carefully using queue_draw_area () should be just as good. (patches welcome :))