GNOME Bugzilla – Bug 711182
Incorrect drawing behaviour with clutter content centered
Last modified: 2014-12-15 17:14:49 UTC
Created attachment 258616 [details] Sample application to illustrate the problem Steps to reproduce: 1. create a reactive actor with CLUTTER_CONTENT_GRAVITY_CENTER 2. create a click handler with the following steps 2a. create a clutterCanvas with a custom draw function, set size to the size of an actor 2b. set the content of the actor to the canvas created in step 2 2c. invalidate the clutterCanvas Expected outcome: on first click, the custom draw handler draws the content What happens instead: nothing, until the window is resized Additional: if click handler is set to toggle between NULL content and custom clutterCanvas, after clicking + window resize subsequent clicks show/hide the content correctly. If removing the clutter content gravity setting, the custom draw handler is correctly invoked from the first click See the attached example file for details. (compile instruction in first-line comment)
After further investigation, I found out that: * this happens with other content_gravity values too * if setting content_gravity AFTER setting the content it works. I still consider this a bug, as I would like to be able to set content_gravity only once, and swap content runtime, without having to set content_gravity again.
Created attachment 292664 [details] [review] actor: Reset the content box when setting a new content We want to recompute the content box when changing the content instance, in case the preferred size is different and the content gravity uses the preferred size; the change of content with different preferred size and same gravity should also trigger an implicit transition.
Attachment 292664 [details] pushed as d546c0c - actor: Reset the content box when setting a new content