After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 427660 - Animated images triggers unnecesary expose-events
Animated images triggers unnecesary expose-events
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Quartz
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-quartz maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-04-08 20:10 UTC by Erik van Pienbroek
Modified: 2007-04-18 20:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Testcase demonstrating the described behaviour (1.04 KB, text/x-csrc)
2007-04-08 20:11 UTC, Erik van Pienbroek
  Details
Animated gif used for this testcase (1.83 KB, image/gif)
2007-04-08 20:12 UTC, Erik van Pienbroek
  Details
The same testcase, but without the use of animated gifs (1.04 KB, text/x-csrc)
2007-04-08 20:13 UTC, Erik van Pienbroek
  Details
Only update needed parts (2.36 KB, patch)
2007-04-10 18:37 UTC, Richard Hult
none Details | Review

Description Erik van Pienbroek 2007-04-08 20:10:50 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:
Comment 1 Erik van Pienbroek 2007-04-08 20:11:38 UTC
Created attachment 86025 [details]
Testcase demonstrating the described behaviour
Comment 2 Erik van Pienbroek 2007-04-08 20:12:00 UTC
Created attachment 86026 [details]
Animated gif used for this testcase
Comment 3 Erik van Pienbroek 2007-04-08 20:13:00 UTC
Created attachment 86027 [details]
The same testcase, but without the use of animated gifs
Comment 4 Richard Hult 2007-04-10 18:37:33 UTC
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.
Comment 5 Erik van Pienbroek 2007-04-10 18:54:19 UTC
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.
Comment 6 Erik van Pienbroek 2007-04-15 21:54:46 UTC
I've just tested your patch and the performance of my program is way better than before with it!
Comment 7 Richard Hult 2007-04-16 06:33:06 UTC
Thanks, I'll test some more to make sure we don't regress and then commit.
Comment 8 Richard Hult 2007-04-18 20:14:31 UTC
Committed to trunk.