We often mean that when key_focus == NULL, it's assumed to be on the
stage, and clutter_stage_get_key_focus() reflects this. We also do a
lot of check around the lines of key_focus == NULL instead of also
checking for the stage, so make sure to normalize it so that explicitly
grabbing the stage's key focus will not change our behaviour.
https://bugzilla.gnome.org/show_bug.cgi?id=683301
The ClutterEventSequence structure is a fully opaque type; on X11, it is
just an unsigned integer that gets converted into a pointer, but in the
future it may become a fully fledged data structure.
Obviously, we cannot tell people to just dereference the pointer into an
integer in order to use it, and still retain the ability to change the
type; for this reason, we need a proper accessor function to convert the
EventSequence into a touch detail, to be used with the XInput API.
The ordering of the evdev button numbers is the opposite of the
order in Clutter (the middle button is 3 instead of 2) so we need to
manually map the button numbers when creating a ClutterButtonEvent.
https://bugzilla.gnome.org/show_bug.cgi?id=680255
803b3bafb6 introduced a new issue for
multi touch events.
In the case where 2 touch events for 2 different touch points are
processed in the same iteration, a call to
_clutter_stage_remove_device() when processing the first event will
remove the stage setting of the InputDevice. That means Clutter will
skip the second event, because it can't find a stage to which relate
the event, so no related actor and so no emission.
To fix this we move the _clutter_stage_(add/remove)_device() calls
into the input device. This way the input device can find out exactly
when to call these functions (i.e. when no touch point were previously
active or when no touch point remain active).
https://bugzilla.gnome.org/show_bug.cgi?id=682362
Interpolating between two transformations expressed using a 3D matrix
can be achieved by decomposing the matrices into their transformations
and do a simple numeric interpolation between the initial and final
states, like we do for other data types.
Luckily for us, the CSS Transforms specification from the W3C provides
the decomposition algorithm, using the "unmatrix" code taken from the
book "Graphics Gems II, edited by Jim Arvo".
Once the matrices have been decomposed, we can simply interpolate the
transformations, and re-apply them onto the result matrix, using the
facilities that Clutter provides for interpolating between two known
GTypes.
Since Cogl version 1.11.2, Cogl no longer includes the EGL headers
from cogl.h if COGL_ENABLE_EXPERIMENTAL_2_0_API is defined. Instead
the application needs to include cogl-egl.h so that we can avoid
polluting the global namespace with X defines. Clutter defines the 2.0
define in its configure.ac and it is relying on Cogl to include the
right EGL header in clutter-egl-headers.h so we need to change which
header it includes.
When changing an implicit transition mid flight we may end up with an
easing state with a duration of zero milliseconds; this leads to the
implicit transition machinery setting the final state directly onto the
actor. If there is a running transition, though, we need to remove it
from the transitions table, otherwise it will keep running.
This regression happened when the update_transition() internal function
was merged into the create_transition() one.
Tested-by: Lionel Landwerlin <llandwerlin@gmail.com>
PanAction is a GestureAction-subclass that implements the panning
concept for scrollable actors, with the ability to emit interpolated
signals to emulate the kinetic inertia of the panning. PanAction provides:
• pan signal, notifying users of the panning gesture status;
• pan-stopped signal, emitted at the end of the interpolated phase
of the panning gesture, if enabled;
• pan-axis property, to allow constraining the dragging to a specific
axis;
• interpolated property, to enable or disable the inertial behaviour;
• deceleration property, to customize the rate at which the momentum
of the panning will be slowed down;
• acceleration-factor property, applied to the inertial momentum when
starting the interpolated sequence.
An interactive test is also provided.
https://bugzilla.gnome.org/show_bug.cgi?id=681648
Add some accessors to simplify common tasks for GestureAction users:
• clutter_gesture_action_get_motion_delta() to get the delta
on the X and Y axis in stage coordinates since the last motion
event, and the scalar distance travelled;
• clutter_gesture_action_get_velocity() to get an estimate of the
speed of the last motion event along the X and Y axis and as a
scalar value in pixels per millisecond.
https://bugzilla.gnome.org/show_bug.cgi?id=681648
When appending (with a negative row/column parameter), the row/column
count should be incremented by 1, not 2. This also fixes layout errors
when using column/row spacing: The amount of extra space required was
calculated incorrectly due to the wrong column count.
https://bugzilla.gnome.org/show_bug.cgi?id=679990
When setting a drag handle, transform the original press
coordinates using the drag handle as reference instead of the
associated actor.
This causes the initial misplacement of drag handle in
example/drag-action when holding down the Shift key: the handle
gets placed at the main actor origin on the first drag event,
instead of following the mouse pointer.
All subsequent motion events already use the right actor when
transforming the coordinates, thus they are not affected.
https://bugzilla.gnome.org/show_bug.cgi?id=681746
If the DragAction has a drag handle that gets destroyed inside the
::drag-end signal handler, the destruction sequence will trigger a
callback we have in place to check if the handle is being destroyed
mid-drag, e.g. from a ::drag-motion event.
The callback on the drag handle destruction will check if we are still
in the middle of a drag and emit the ::drag-end signal to allow cleaning
up; the callback erroneously uses the drag handle as the argument for
the emit_drag_end() function — instead of the actor to which the drag
action has been attached. Also, by the time we emit the ::drag-end, we
are not dragging the actor any more, so we shouldn't be emitted the
::drag-end signal twice.
The fix is, thus, made of two parts:
- reset the in_drag boolean before emitting the ::drag-end signal
so that destroying the drag handle will not result in a double
signal emission;
- use the correct actor when calling emit_drag_end().
https://bugzilla.gnome.org/show_bug.cgi?id=681814
If the actor has a fixed position set, but it's not using the BinLayout
alignment enumeration to set its alignment, then we force the alignment
factor to 0.0; this is consistent with what happens with an explicit
alignment of CLUTTER_BIN_ALIGNMENT_FIXED.
https://bugzilla.gnome.org/show_bug.cgi?id=682265
Event handling should only apply to editable ClutterText actors, but we
also have the :selectable property to care about.
The button/touch press should position the cursor inside an editable
ClutterText; the :selectable property should be used to allow selecting
the text, either through pointer or touch dragging, via the keyboard, or
by multiple pointer clicks. If neither of these two conditions are met,
the ClutterText should just propagate the event handling further.
Allow setting a ClutterRect on the drag action and force the
dragged actor's position to be always within that rectangle (relative
to the actor's parent).
https://bugzilla.gnome.org/show_bug.cgi?id=681168
The boolean_handled accumulator will stop the signal emission if TRUE is
returned by a signal handler; the boolean_continue accumulator will stop
the signal emission if FALSE is returned. The first one is used for
event-related signals, while the latter is used for action-related
signals.
Only the signal connection. When using G_ENABLE_DIAGNOSTIC there will be
a warning for every signal connection.
We should try and discourage people from ever using the paint signal
ever again, until we can safely remove it in Clutter 2.0.
We cannot fully deprecate Geometry, because ClutterActor and ClutterText
are actually using the type in signals and properties; but we can
deprecate the API that uses this type, so that 2.0 will be able to avoid
it entirely.
The :clip property still uses ClutterGeometry, which is a very bad
rectangle type. Since we cannot change the type of the property
compatibly, we should introduce a new property using ClutterRect
instead. This also matches the ClutterActor.set_clip() API, which uses a
decomposed rectangle with floating point values, like we do with
set_position() and set_size().