GNOME Bugzilla – Bug 427660
Animated images triggers unnecesary expose-events
Last modified: 2007-04-18 20:14:31 UTC
Please describe the problem: Hi, In the attached testcase I've used a GtkNotebook which contains an animated gif in the tab_label. In the GtkNotebook itself is a GtkDrawingArea which currently prints out a message every time the expose event is triggered. As you can see the expose event of the GtkDrawingArea gets triggered every time the animated gif advances a frame. If the animated gif code is commented out the expose event of the drawing area is only triggered once (as it should be). In larger applications this behaviour can cause 100% cpu use. Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
Created attachment 86025 [details] Testcase demonstrating the described behaviour
Created attachment 86026 [details] Animated gif used for this testcase
Created attachment 86027 [details] The same testcase, but without the use of animated gifs
Created attachment 86126 [details] [review] Only update needed parts This patch changes process_updates so that it only updates the needed changes. Without this change, the full GdkWindow is updated even if it's not needed. The bug you are seeing is caused by this, as GtkImage is a nowindow widget, so the window is the parent, in this case the notebook. I have tested this patch with your test case and some other tests, I haven't found any case that it breaks, but if you could give it a spin too, that would be great.
Great work! I really appreciate it! Unfortunately I'm currently out of reach of a Mac OS X86 box so I can't test your patch till Sunday. I will get back you when I've tested your patch.
I've just tested your patch and the performance of my program is way better than before with it!
Thanks, I'll test some more to make sure we don't regress and then commit.
Committed to trunk.