GNOME Bugzilla – Bug 331599
GtkNotebook flicker problem on Win32 with background pixmap set
Last modified: 2006-05-16 20:43:20 UTC
This problem only appears on Win32 (I am using gtk+ 2.8.9). When a set of widgets is created at run-time and added to a notebook page that has a background pixmap set, there is a very noticeable and unacceptable flicker. It appears that the widget is being painted with a grey background before being updated to the pixmap. My application uses GtkEventBoxes with their "visible window" turned off but I think it is also occuring for other "see-through" widgets. I think this may be related to <a href="http://bugzilla.gnome.org/show_bug.cgi?id=144269">Bug #144269</a> but I don't know enough about the internals to play with this or really know what I am doing. The thing I have discovered is that if you add the widgets to the notebook before calling gtk_main(), there will be no flicker, even if the background pixmap is changing, it seems to only affect widgets that are added at runtime. I have created a test program which I hope illustrates this. The program has 3 tabs, the first just allows you to choose one of the other 2 tabs. Each of the other tabs has a table of widgets that simulate a "multiple-choice" question. One of the tabs is created at run-time and therefore exhibits the flicker problem. The other tab is identical except it was added before gtk_main() is called and therefore doesn't exhibit the flicker problem. Needless to say, my real program needs to generate the pages at run-time (the multiple choice questions/backgrounds are read in from an XML file). I have not been able to figure out any sort of work around. As this demo program illustrates, it's not when the resources are allocated that is the problem it's when they are added and drawn, somehow. The images used are from art.gnome.org, hopefully it doesn't offend any copyrights to include them in this bug-report.
Created attachment 59607 [details] Test case, pre-compiled windows executable, source file, makefile, and images Contains a pre-compiled executable as well as the source/make files. Images contained herein are from art.gnome.org
I've spent more time on this and it appears that I was incorrect in claiming that the flicker only occurs when notebook pages are created at run-time, I am seeing the flicker on pages created before gtk_main. It seems to be a more generic double-buffer problem with eventboxes/images/gtknotebook on win32. Although the test case submitted earlier still demonstrates this bug, I will try to create a simpler, more generic one.
I still have not discovered exactly why and when this bug manifests itself but the patch given in Bug #144269 solves it completely. I think this bug report should be closed as a duplicate bug. *** This bug has been marked as a duplicate of 144269 ***