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 711182 - Incorrect drawing behaviour with clutter content centered
Incorrect drawing behaviour with clutter content centered
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: ClutterActor
1.16.x
Other Linux
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2013-10-30 21:39 UTC by Robert Roth
Modified: 2014-12-15 17:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample application to illustrate the problem (3.21 KB, text/x-csrc)
2013-10-30 21:39 UTC, Robert Roth
  Details
actor: Reset the content box when setting a new content (1.70 KB, patch)
2014-12-13 14:32 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review

Description Robert Roth 2013-10-30 21:39:38 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)
Comment 1 Robert Roth 2013-10-30 23:00:19 UTC
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.
Comment 2 Emmanuele Bassi (:ebassi) 2014-12-13 14:32:50 UTC
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.
Comment 3 Emmanuele Bassi (:ebassi) 2014-12-15 17:14:36 UTC
Attachment 292664 [details] pushed as d546c0c - actor: Reset the content box when setting a new content