clutter_stage_schedule_update() sets the field `update_scheduled` to
`TRUE` as an optimization to make redundant updates a no-op. This failed
if there was a pending event and if the stage was not yet mapped.
What happened is:
* clutter_stage_schedule_update() is called
- ClutterStage::update_scheduled is set to TRUE
- frame clock scheduled
* frame clock dispatches
- frame is discarded early, no actual stage update happens
* device is created (e.g. virtual device from remote desktop session)
- `device-added` event reaches ClutterStage::event_queue
* stage is shown
- clutter_stage_schedule_update() is called
- ClutterStage::update_scheduled is TRUE
- ClutterStage::event_queue has events in it
- These two conditions means clutter_schedule_update() becomes a
no-op
At this point, no more updates will happen from
clutter_stage_schedule_update().
Fix this by resetting `ClutterStage::update_scheduled` to `FALSE` even
if the frame was discarded due to the stage not yet being mapped.
A test case is added that replicates the above descibed events.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3804
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4152>
When using a tablet tool in relative mode motion compression may
apply. Doing so drops the axes from the event, leading to a segfault
later when we're trying to broadcast_axis() an event without axes.
Fix this by making sure we copy the axes over during motion compression.
All but the wheel are absolute so we can just take them from the new
event but if we do have wheel data add them together and where the wheel
changes direction skip motion compression.
We can take a few shortcuts here because the clutter implementation
guarantees exactly CLUTTER_INPUT_AXIS_LAST axes so we only need to
put in warning checks in case that ever changes.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3766
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4117>
The constructor already copies the pipeline which means we can add a
snippet safely without affecting the parent pipeline, without creating
another copy.
Fixes: 6b07141f1a ("clutter/paint-nodes: Make paint nodes handle color transformations")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4037>
As it ends up using the global default context. So just call that
directly to easily spot the remaining usages of get_default_context.
Note that the helper will probably be removed later this cycle once the
remaining usages in meta & libst have been replaced with passing around
the context
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4077>
As they are not used anywhere, in the next commit
we will just remove the whole thing and use glib helpers directly as
there is nothing specific about ClutterThread anymore
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4077>
While in double buffering we only care about one previous presentation,
triple buffering will sometimes need to refer to the presentation from
two dispatches prior. So it might help to separate those frame stats
more clearly. This way each frame's dispatch and presentation times are
stored more cohesively such as to not be overwritten during overlapping
frame lifetimes.
Having two types of frame reference (dispatch and presentation) moving
at difference speeds meant that they could not be stored in a ring. Not
all dispatches become presentations and so storing them in a ring would
necessitate very complex conflict avoidance. Instead, a simple reference
counting model was used.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3961>
So that we maintain a perfectly balanced number of callbacks:
dispatch == notify_ready + notify_presented
Otherwise you can't put any useful logic inside notify_ready and be sure
you're handling all the empty frames.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3961>
As that is where the whole text rendering integration happens
And would allow us to get rid of some over-abstraction in cogl-pango,
simplify
ClutterSnapshot integration as well
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
Instead of duplicating a string we own already we can just steal it from
the array that we're using.
This is safe since we're sure about the tokens GStrv length and we are
always stealing the last element, so there is no risk that g_strfreev
would eventually leak something.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4071>
Previously ClutterStageWindow was an interface with only one base
implementation (MetaStageImpl) which others inherit from.
This just makes it a class so that we can use _GET_CLASS() API instead of
the costly (by comparison) _GET_IFACE() vtable lookups.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4048>
clutter_primaries_to_wayland made sense when there only existed
ClutterColorspace. Now that ClutterPrimaries also exist, it makes more
sense to change that func to clutter_colorspace_to_wayland.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4062>
Quoting Ebassi https://www.bassi.io/articles/2023/02/20/bindable-api-2023/:
Whenever you’re describing a function that takes a callback, you
should always annotate the callback argument with the argument that
contains the user data using the (closure argument) annotation
You should not annotate the data argument with a unary (closure).
The unary (closure) is meant to be used when annotating the callback
type
Recently gobject-introspection became a bit more strict with this and
that generated some warnings:
Warning: Cogl: invalid "closure" annotation: only valid on callback
parameters
This commit fix all the closure annotations.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4058>
This TF can't be defined as a TransferFunction enum because it needs a
gamma_exp value too.
Add to EOTFType enum a new type: EOTF_TYPE_GAMMA.
With this new type, now EOTFs are unions that can have either
a TransferFunction enum or a gamma_exp.
Set gamma_exp as uniform.
Add the support of it in the color management protocol.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>