Commit Graph

5817 Commits

Author SHA1 Message Date
Samuel Degrande
76fb468319 deform-effect: Set cull-face mode on the correct pipeline
Fix a function call to set the cull-face mode of the back_pipeline:
the function was called on the 'front-pipeline' instead of the
back-pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=701208
2013-06-12 10:41:57 +01:00
Craig R. Hughes
e54246dd69 Extra ref leak in clutter_actor_set_child_at_index too
https://bugzilla.gnome.org/show_bug.cgi?id=696813
2013-06-12 10:14:26 +01:00
Craig R. Hughes
90f68edbda clutter_actor_set_child_above/below_sibling leaking a reference
https://bugzilla.gnome.org/show_bug.cgi?id=696813
2013-06-12 10:14:25 +01:00
Emmanuele Bassi
cbf0199804 actor: Fix has_constraints() and has_actions()
When we changed the MetaGroup to handle internal effects, we updated
has_effects(), but forgot to fix the equivalent has_constrains() and
has_actions() method.

Now, if we clear the constraints or the actions on an actor, and we
call has_constraints() or has_actions(), we get an false positive.
2013-06-12 10:04:32 +01:00
Emmanuele Bassi
e1fe999db0 stage: Ensure that we don't pick during destruction
When destroying a ClutterStage we should just skip picking operations,
to avoid calling into a state that is being torn down.
2013-06-12 10:04:31 +01:00
Matthias Clasen
d343cc6289 x11: trap errors when calling XIQueryDevice
Devices can disappear at any time, causing XIQueryDevice
to throw an error. At the same time, plug a memory leak.

https://bugzilla.gnome.org/show_bug.cgi?id=701974
2013-06-10 21:45:47 -04:00
Emmanuele Bassi
0065fb459c Revert "units: Handle negative values in clutter_units_from_string()"
Stray commit got pushed too soon.

This reverts commit 44f283bb72.
2013-05-22 14:34:22 +01:00
Bastian Winkler
44f283bb72 units: Handle negative values in clutter_units_from_string()
In order to allow values like "-2cm" in ClutterScript,
clutter_units_from_string() needs to handle negative values as well.
2013-05-22 15:26:12 +02:00
Emmanuele Bassi
19391a9626 cally: Use a weak pointer to hold the key focus in CallyStage
We want to avoid the pointer getting stale, and causing crashes.

https://bugzilla.gnome.org/show_bug.cgi?id=692706
2013-05-17 15:27:51 +01:00
Emmanuele Bassi
755f41f559 canvas: Remove invalidate_with_size()
We can replace it by adding a return value to set_size() that can tell
us if the set_size() invalidated the contents of the canvas or not.
2013-05-15 20:08:02 +01:00
Emmanuele Bassi
323ec19dcc build: Remove INCLUDES directives
They have been deprecated for a while, replaced by AM_CPPFLAGS.
2013-05-15 15:18:13 +01:00
Lionel Landwerlin
9c6f3793e8 offscreen-effect: limit offscreen fbo size to the stage's size
When using a ClutterOffscreenEffect, the size of the offscreen buffer
allocated to perform the effect is currently computed using the paint
volume of the actor it's attached to and in the case the paint volume
cannot be computed, the effect falls back to using the stage's size.

If you scale an actor enough so its paint volume is much bigger that
the size of the stage, you can end up running out of memory (which
leads to your application crashing).

https://bugzilla.gnome.org/show_bug.cgi?id=699675
2013-05-15 14:58:45 +01:00
Chris Cummins
242f611863 clutter-input-device-wayland: Update indentifier name
Fixes a discrepancy between the function name and the gtk-doc identifier
introduced in 8f4e39b6 when the Wayland input protocol changed.
2013-05-14 12:42:08 +01:00
Chris Cummins
3de7e49432 docs: Remove empty line before parameter tags
The gtk-doc parser has somewhat esoteric rules regarding blank lines and
paragraph breaks, causing these parameter descriptions to be missed. See:

https://developer.gnome.org/gtk-doc-manual/stable/documenting_syntax.html.en
2013-05-14 12:42:08 +01:00
Chris Cummins
a075c286f2 clutter-stage-wayland: Pedantic typo fix
Je ne parle pas français
2013-05-14 12:42:08 +01:00
Chris Cummins
15bed2d9bd wayland: Add API version annotations
Version numbers have been derived from source code comment blocks.
2013-05-14 12:42:08 +01:00
Bastian Winkler
cd9ba0ad8d flow-layout: Add :snap-to-grid property
Add a :snap-to-grid property to FlowLayout to prevent the layout from
assigning it's children a position based on the size of the largest
child.

https://bugzilla.gnome.org/show_bug.cgi?id=648873
2013-05-11 10:54:38 -04:00
Emmanuele Bassi
fd9109e6d6 Fix up "allow-none" annotation 2013-05-06 10:20:36 -07:00
Emmanuele Bassi
9424e995fa actor: Improve conditions for skipping implicit transitions
The "should this implicit transition be skipped" check should live into
its own function, where we can actually explain what it does and which
conditions should be respected.

Instead of just blindly skipping actors that are unmapped, or haven't
been painted yet, we should add a couple of escape hatches.

First of all, we don't want :allocation to be implicitly animated until
we have been painted (thus allocated) once; this avoids actors "flying
in" into their allocation.

We also want to allow implicit transitions on the opacity even if we
haven't been painted yet; the internal optimization that we employ in
clutter_actor_paint() and skips painting fully transparent actors is
exactly that: an internal optimization. Caller code should not be aware
of this change, and it should not influence code outside of ClutterActor
itself.

The rest of the conditions are the same: if the easing state's duration
is zero, or if the actor is both unmapped and not in a cloned branch of
the scene graph, then implicit transitions are pointless, as they won't
be painted.

https://bugzilla.gnome.org/show_bug.cgi?id=698766
2013-05-06 10:04:22 -07:00
Emmanuele Bassi
f92b78781d stage: Use precomputed constants instead of trigonometric functions
This should actually ensure that the calculations of the Z translation
for the projection matrix is resolved to "variable * CONSTANT". The
original factors are left in code so it's trivial to revert to the
trigonometric operations if need be, even without reverting this commit.
2013-05-06 10:04:22 -07:00
Emmanuele Bassi
d061a47573 stage: Add a paint callback
The ClutterActor::paint signal is deprecated, and connecting to it even
to get notifications will disable clipped redraws because of violations
of the paint volume.

The only actual valid use case for notifications of a successful frame
is on the ClutterStage, so we should add new (experimental) API for it,
so that users can actually subscribe to it — at least if you're writing
a compositor.

Shoving a signal in a performance critical path is not an option, and
I'm not sure I want to commit to an API like this yet. I reserve the
right to revisit this decision in the future.

https://bugzilla.gnome.org/show_bug.cgi?id=698783
2013-05-06 10:04:21 -07:00
Emmanuele Bassi
264c67c2aa canvas: Allow invalidating the content along with the size
Currently, clutter_canvas_set_size() causes invalidation of the canvas
contents only if the newly set size is different. There are cases when
we want to invalidate the content regardless of the size set, but we
cannot do that right now without possibly causing two invalidations,
for instance:

  clutter_canvas_set_size (canvas, new_width, new_height);
  clutter_content_invalidate (canvas);

will cause two invalidations if the newly set size is different than
the existing one. One way to work around it is to check the current
size of the canvas and either call set_size() or invalidate() depending
on whether the size differs or not, respectively:

  g_object_get (canvas, "width", &width, "height", &height, NULL);
  if (width != new_width || height != new_height)
    clutter_canvas_set_size (canvas, new_width, new_height);
  else
    clutter_content_invalidate (canvas);

this, howevere, implies knowledge of the internals of ClutterCanvas,
and of its optimizations — and encodes a certain behaviour in third
party code, which makes changes further down the line harder.

We could remove the optimization, and just issue an invalidation
regardless of the surface size, but it's not something I'd be happy to
do. Instead, we can add a new function specifically for ClutterCanvas
that causes a forced invalidation regardless of the size change. If we
ever decide to remove the optimization further down the road, we can
simply deprecate the function, and make it an alias of invalidate()
or set_size().
2013-05-06 10:03:54 -07:00
Lionel Landwerlin
f66108e43a zoom-action: improve zooming behavior
https://bugzilla.gnome.org/show_bug.cgi?id=698674
2013-04-23 17:36:47 +01:00
Lionel Landwerlin
5a7a6ebfc4 gesture-action: refactor event handling function
https://bugzilla.gnome.org/show_bug.cgi?id=698671
2013-04-23 17:36:47 +01:00
Lionel Landwerlin
321553b139 gesture-action: fix trigger edge after behavior with more than 1 point
https://bugzilla.gnome.org/show_bug.cgi?id=698669
2013-04-23 17:36:47 +01:00
Lionel Landwerlin
fda406b4a8 gesture-action: add n-touch-points property
https://bugzilla.gnome.org/show_bug.cgi?id=698668
2013-04-23 17:36:47 +01:00
Lionel Landwerlin
82e5634117 gesture-action: avoid shadowing time() syscall function
https://bugzilla.gnome.org/show_bug.cgi?id=698668
2013-04-23 17:28:41 +01:00
Lionel Landwerlin
d691761985 gesture-action: fix typo
https://bugzilla.gnome.org/show_bug.cgi?id=698668
2013-04-23 17:28:34 +01:00
Emmanuele Bassi
0538adc58c timeline: Ensure the range on the cubic bezier control points
The X coordinate has to be in the [ 0.0, 1.0 ] range.
2013-04-05 15:35:15 +01:00
Emmanuele Bassi
8c32637eea Deprecate ClutterGeometry
It's a bad rectangle type, with caveats and gotchas. We have better
types, courtesy of Cairo, as well as our own (ClutterRect).

https://bugzilla.gnome.org/show_bug.cgi?id=682789
2013-04-04 11:53:39 +01:00
Emmanuele Bassi
1724536cda text: Add ::cursor-changed signal
Since we are trying to eliminate the ClutterGeometry type, we should
replace the only entry point still using it: the ::cursor-event signal
of ClutterText.

Instead of passing the cursor geometry, we should add an accessor
function.

The combination of signal and getter for the cursor geometry means that
we can deprecate ClutterText::cursor-event, and mark it for removal in
Clutter 2.0.

https://bugzilla.gnome.org/show_bug.cgi?id=682789
2013-04-04 11:53:39 +01:00
Emmanuele Bassi
03296e30e7 Fix compilers warnings when debugging is disabled 2013-04-04 11:53:38 +01:00
Emanuele Aina
56844a2b75 tap-action: Fix the docs, it does not require actors with children 2013-04-01 19:10:36 +02:00
Neil Roberts
d5896d284e wayland: Queue a redraw after showing the stage
On the other backends we will get some sort of expose event after
showing the stage's window which will queue a redraw. These expose
events don't exist on Wayland so nothing will cause Clutter to queue a
redraw. Weston doesn't bother displaying anything for the stage's
surface until the first buffer is sent, which of course it will never
receive if Clutter doesn't paint anything. This patch just makes it
explicitly queue a redraw after the stage is shown so that we will
always pass at least one frame to the compositor.

The bug can be seen by running test-stage-sizing. That example doesn't
have any animations so it won't try to queue any redraws until
something interacts with it. On the other hand something like
test-actors works fine without the patch because it constantly queues
redraws anyway in order to display the animation.

https://bugzilla.gnome.org/show_bug.cgi?id=696791
2013-03-28 16:12:34 +00:00
Emmanuele Bassi
23707ac242 Add version-related macros for 1.16 2013-03-20 17:23:02 -03:00
Lionel Landwerlin
b914ae70b1 actor: fix translation-z setting
https://bugzilla.gnome.org/show_bug.cgi?id=695982
2013-03-18 10:39:08 +00:00
Bastien Nocera
bbb54f1aed clutter: Prefer the X11 backend to the Wayland one
If clutter is built with both X11 and Wayland support, prefer the
(more complete for now) X11 backend. This matches GTK+'s current
ordering.

This allows distributions to ship a clutter version with both backends
built, and using an envvar to switch to the wayland backend and test
applications.

In the future, applications would be able to choose which backend
they prefer and in which order.

https://bugzilla.gnome.org/show_bug.cgi?id=695838
2013-03-14 15:29:00 +01:00
Emmanuele Bassi
73dbd17948 symbols: Add missing symbol 2013-03-13 16:00:36 -03:00
Emmanuele Bassi
8f032d5952 actor: Skip transitions on invisible actors
If an actor has not been painted yet, or it's not going to be painted,
we can ignore transitions queued on it.

By ignoring transitions on actors that have not been painted yet, we can
avoid doing work during the set up phase of the scene graph, as well as
avoiding actors "flying in" from nowhere.

Obviously, we have to take into account potential clones, so we need to
check that the actor is not part of a cloned branch of the scene graph,
as well as checking if the actor has mapped clones.
2013-03-13 15:05:28 -03:00
Emmanuele Bassi
20c0985869 actor: Propagate the cloned state to the children
If we clone a container, we still want redraws queued on the children to
be propagated.
2013-03-13 15:05:28 -03:00
Emmanuele Bassi
0e0db890e1 actor: Ignore redraws queued on unmapped actors
If an actor is unmapped then it won't be painted, so we can safely
short-circuit out of _clutter_actor_queue_redraw_full() if the mapped
flag is not set.

We need, on the other hand, make an exception for Clones, otherwise
they won't receive notification that the source actor has changed
and they won't be painted.

This allows us to ignore redraws queued on children of invisible
parents, and avoid traversing the scene graph.
2013-03-13 15:05:28 -03:00
Emmanuele Bassi
028baa99a0 actor: Keep track of clones
Instead of using signal notifications, we should be able to keep track
of the clones of an actor from within ClutterActor itself, using private
API. There's no point in pretending that people can actually create a
Clone class out of tree, given the amount of invariants we have to punch
through in order to implement a proper replicator node of the scene
graph, so we can just skip the signal emissions and just do the right
thing at the right time.
2013-03-13 15:05:28 -03:00
Emmanuele Bassi
c32973158d actor: Clean up internal add/remove functions
More comments are warranted: these functions are pretty much full of
potential side effects, and I'd really like to avoid keeping everything
in my head forever.

Along with the comments and the type casting reduction, I sneaked in a
one line change that is clearly correct after reading the flow of the
whole thing: we queue only a relayout after three potential redraws have
been queued. If we manage to miss a redraw and yet still get a relayout
then it means that most of our assumptions are fundamentally wrong, and
that we ought to dump this whole business of computer programming, and
just go back to being a hunter-gatherer species.
2013-03-13 15:05:28 -03:00
Emmanuele Bassi
900015a4eb actor: Clean up ::show and ::hide class handlers
The main body of the function should not live inside an 'if' block.
2013-03-13 15:05:27 -03:00
Emmanuele Bassi
041d8b5d29 Clean up the Actor private header
Reading it is getting painful.
2013-03-13 15:05:27 -03:00
Alejandro Piñeiro
9618f37b1d Add method clutter_disable_accessibility ()
https://bugzilla.gnome.org/show_bug.cgi?id=691468
2013-03-13 18:56:58 +01:00
Jasper St. Pierre
36e25374cc event: Use gunichar when dealing with unicode characters
This makes introspection return the keycode as a string, rather
than an integer.

https://bugzilla.gnome.org/show_bug.cgi?id=695188
2013-03-12 17:09:29 -04:00
Jasper St. Pierre
c26d724f3d clutter-backend: Request XI2.3
Since XIQueryVersion, the bad API that it is, chooses the first client
version that it gets, we need to ensure that we pass XIQueryVersion the
new XI2.3 version, knowing fully well that Clutter won't be confused
by the new features.

https://bugzilla.gnome.org/show_bug.cgi?id=692466
2013-03-12 17:09:29 -04:00
Jasper St. Pierre
009da0c6ce x11: Always request XI2.2
The X server should fill in the minor version that it supports in the
case where it only supports the older version. We should not get a
BadRequest or fail the version check if we pass something higher.

https://bugzilla.gnome.org/show_bug.cgi?id=692466
2013-03-12 17:09:29 -04:00
Sebastian Keller
9dbc01b61f xi2: Reset scroll info for correct device on device change 2013-03-12 17:09:29 -04:00