1
0
Fork 0
Commit graph

7606 commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
eed368ee91 clutter: Always make the seat handle the events first
Some events such as the proximity one requires a device to be set before
we process them, so ensure we process the event details after we've
added the device to the seat.

This may lead to handle a device-removed signal before the clutter event
but it's anyways not different from what we did before commit 012c0a18

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1779>
2021-03-13 21:36:25 +00:00
Jonas Ådahl
1ff1100d76 cally/stage: Don't add weak pointer to stage
The CallyStage objects lifetime is tied to the stage, so if we add a
weak pointer to it, we won't be able to remove it, as we would try to do
so not until the stage itself is being disposed, at which point removing
it fails. However, not removing it will make the stage try to clean up
the weak refs, and since it does this more or less directly after
freeing the cally stage, it ends up writing NULL to freed memory,
causing memory corruption.

Fix this by avoiding adding the weak pointer when that pointer is to the
stage.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1775>
2021-03-13 18:56:21 +00:00
Jonas Ådahl
c1810d6947 backend: Destroy clutter backend explicitly
Instead of relying on reference counting, destroy it with a destroy
function that calls run_dispose() on before removing a reference.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1775>
2021-03-13 18:56:21 +00:00
Jonas Ådahl
ab600cafd2 backend: Destroy seat explicitly
Don't let any dangling pointer keeping it alive.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1775>
2021-03-13 18:56:21 +00:00
Jonas Ådahl
6ecd911dd0 backend: Take over seat ownership from the clutter backend
Having the clutter backend owning and managing creates complication for
implementing graceful shutdown, so move it to the real backend.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1775>
2021-03-13 18:56:21 +00:00
Daniel van Vugt
56fc09151d clutter/frame-clock: Evenly space updates when presentation times are zero
This is for the Nvidia-X11 driver where `last_presentation_time_us` is
always zero. Other drivers should be unaffected.

The existing `calculate_next_update_time_us` algorithm only provides a
guarantee of not scheduling faster than the refresh rate in the presence
of a valid `last_presentation_time_us`. When `last_presentation_time_us`
is zero there is no solid foundation to guarantee we're not occasionally
scheduling too early. So introduce one now.

By introducing a hard guarantee that updates are never scheduled faster
than the refresh rate, we avoid keeping Nvidia's triple (or quad?) buffer
queue full. So this avoids the high latency and random stalls experienced
on Nvidia.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/818,
        https://gitlab.gnome.org/GNOME/mutter/-/issues/1273,
        https://gitlab.gnome.org/GNOME/mutter/-/issues/1287,
        https://gitlab.gnome.org/GNOME/mutter/-/issues/1291,
        https://gitlab.gnome.org/GNOME/mutter/-/issues/1583

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1726>
2021-03-12 16:01:38 +00:00
Jonas Ådahl
9b1b4eb843 clutter: Expose 'capture_view_into()` as API
It'll be used to explicitly capture the content of a single view.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1698>
2021-03-12 15:09:45 +00:00
Jonas Ådahl
d7ce6a47f8 tests: Add reference test framework
This adds a test framework that makes it possible to compare the result
of painting a view against a reference image. Test reference as PNG
images are stored in src/tests/ref-tests/.

Reference images needs to be created for testing to be able to succeed.
Adding a test reference image is done using the
`MUTTER_REF_TEST_UPDATE` environment variable. See meta-ref-test.c for
details.

The image comparison code is largely based on the reference image test
framework in weston; see meta-ref-test.c for details.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1698>
2021-03-12 15:09:45 +00:00
Marco Trevisan (Treviño)
012c0a18ef clutter: Ensure we always call handle_event_post for processed events
Since commit 2ceac4a device-related X11 events aren't processed anymore,
causing the input settings not to handle the devices.
This is due to the fact that we may never call clutter_seat_handle_event_post()
for such events.

While this is always happening for the native backend, it doesn't happen in
X11 because the events are removed from the queue as part of
meta_x11_handle_event(), and thus no event was queued to the stage by the
backend events source.

This also makes sure that the event post handler is called after the
event is actually processed, and not before an event is queued.

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1564
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1769>
2021-03-10 13:56:54 +00:00
Jonas Ådahl
393a85971c clutter/stage-view: Disable double buffered shadow buffering
To make the double buffered shadow buffer damaged tiles detection
feasable, a new EGL extension is needed for creating FBO's backed by
a custom CPU memory buffer, instead of DMA buffers, as DMA buffers can
be very slow to read, much slower than just painting the shadow buffer
directly.

Leave the code there, since such an EGL extension is intended to be
added, but hide it behind an env var so that it isn't enabled by
accident.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1724>
2021-03-08 11:11:01 +00:00
Ivan Molodetskikh
bb57f35296 wayland: Add presentation_feedback_present()
Regarding the sequence = 0 fallback: in some cases (moving a cursor
plane on atomic amdgpu) we get sequence = 0 in the page flip callback.
This seems like an amdgpu bug, so work around it by assuming a sequence
delta of 1 (it is equal to 1 because of the sequence != 0 check above).

Sequence can also legitimately be 0 if we're lucky during the 32-bit
overflow, in which case assuming a delta of 1 will give more or less
reasonable values on this and next presentation, after which it'll be
back to normal.

Sequence is also 0 on mode set fallback and when running nested, in
which case assuming a delta of 1 every frame is the best we can do.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1484>
2021-03-08 09:48:11 +00:00
Ivan Molodetskikh
02d7fca716 clutter/frame-info: Add VSYNC flag
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1484>
2021-03-08 09:48:11 +00:00
Ivan Molodetskikh
93ef83a96c clutter/frame-info: Add ZERO_COPY flag
Will be used in the presentation-time Wayland protocol.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1484>
2021-03-08 09:48:11 +00:00
Ivan Molodetskikh
99efb40cce clutter/frame-info: Add sequence
It will be used for the presentation-time Wayland protocol.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1484>
2021-03-08 09:48:11 +00:00
Ivan Molodetskikh
4810164885 cogl: Make presentation time always MONOTONIC
This concerns only the cases when the presentation timestamp is received
directly from the device (from KMS or from GLX). In the majority of
cases this timestamp is already MONOTONIC. When it isn't, after this
commit, the current value of the MONOTONIC clock is sampled instead.

The alternative is to store the clock id alongside the timestamp, with
possible values of MONOTONIC, REALTIME (from KMS) and GETTIMEOFDAY (from
GLX; this might be the same as REALTIME, I'm not sure), and then
"convert" the timestamp to MONOTONIC when needed. An example of such a
conversion was done in compositor.c (removed in this commit). It would
also be needed for the presentation-time Wayland protocol. However, it
seems that the vast majority of up-to-date systems are using MONOTONIC
anyway, making this effort not justified.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1484>
2021-03-08 09:48:11 +00:00
Ivan Molodetskikh
d8606829c4 cogl: Report presentation time in microseconds
KMS and GLX device timestamps have microsecond precision, and whenever
we sample the time ourselves it's not the real presentation time anyway,
so nanosecond precision for that case is unnecessary.

The presentation timestamp in ClutterFrameInfo is in microseconds, too,
so this commit makes them have the same precision.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1484>
2021-03-08 09:48:10 +00:00
Ivan Molodetskikh
9f53b691c4 clutter/frame-info: Add HW_CLOCK flag
A flag indicating whether the presentation timestamp was provided by
the display hardware (rather than sampled in user space).

It will be used for the presentation-time Wayland protocol.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1484>
2021-03-08 09:48:10 +00:00
Jonas Dreßler
ef1f65a013 clutter/text: Emit cursor-changed right after setting cursor position
ClutterText has a bit of a mess around its signalling of changes to the
cursor position: There's the position (deprecated) and cursor-position
property, and  there's the cursor-changed and cursor-event (deprecated)
signal. The two properties are supposed to be notified when the cursor
position changes, and the two signals are notified when the cursor
position or size changes.

Now the properties notifications and the signals get fired in two very
different places: The two properties are notified in
clutter_text_set_cursor_position(), while the signals are fired during
the paint cycle when we figured out the final cursor position. The
latter is a pretty bad idea, nobody expects such a signal to be fired
during painting, and also changes to the text that are done in the
signal handler will only be applied on the next paint.

Now StEntry listens to cursor position changes via cursor-changed and
invalidates its text shadow, but since the signal is only notified
during the paint, the old text shadow will still get applied. To fix
this, also emit the cursor-changed signal when we notify the
cursor-position property.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1757>
2021-03-05 18:58:44 +00:00
Jonas Ådahl
ce3fa3938a clutter/keymap: Make caps and num lock state properties
This removes the responsibility of tracking these from the backend to
the base object. The backends are instead responsible for calling the
function to update the values.

For the native backend, it's important that this happens on the correct
thread, so each time either of these states may change, post a idle
callback on the main thread that sets the, at the time of queuing said
callback, up to date state. This means that things on the main thread
will always be able to get a "new enough but not too new" state when
listening on the 'notify::' signals and getting the property value
after.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1739>
2021-03-04 17:39:08 +00:00
Jonas Dreßler
4d54c3c556 clutter: Also pick on BUTTON_PRESS events
In an x11 session, we don't receive motion events from X when the
pointer is above a window. Since commit 734a1859 we only do picking on
motion events though, which means when clicking the mouse to focus a
window, we don't repick and might still think the pointer is hovering
above another window or actor, ending up not focussing the window.

Fix this by always repicking on BUTTON_PRESS events. While this is not
necessary in the wayland session, button presses happen rarely compared
to motion events, so it's not a performance regression to do it in
Wayland sessions, too.

Fixes https://gitlab.gnome.org/GNOME/mutter/-/issues/1660

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1752>
2021-03-03 14:50:25 +01:00
Jonas Dreßler
c6935ad5b7 clutter/text: Avoid relayout on PangoAttributes changes when possible
ClutterText allows setting a custom PangoAttrList, and St uses that to
set the text style it's reading from CSS. One style St enforces using
this mechanism is the text color and setting the text color should
obviously not affect the size of the layout. ClutterText does queue a
relayout in that case though because it unconditionally queues a
relayout when updating the PangoAttrList.

We can avoid this relayout by reusing an optimization ClutterText has:
clutter_text_queue_redraw_or_relayout() will only queue a relayout if
the requested size of the layout changed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1750>
2021-03-02 15:01:03 +00:00
Alexander Mikhaylenko
2a71ca373b clutter: Add API for retrieving gesture unaccelerated deltas
This will be useful for better aligning behavior between scrolling and
swiping for gnome-shell swipe tracker.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1353>
2021-02-27 08:52:00 +00:00
Robert Mader
8b977e9046 clutter: Stop using GSlice
It has been inofficially deprecated for years, is known to cause issues
with valgrind and potentially hides memory corruption.
Lets stop using it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1512>
2021-02-22 13:52:27 +01:00
Jonas Dreßler
1922896f07 clutter: Also pick on TOUCH_BEGIN events
With 734a185915 an optimization was
introduced to only pick on events which can actually cause the pointer
to move. In case of touch events, the first event (TOUCH_BEGIN) will
already move the touchpoint though, and we'll send our crossing
CLUTTER_ENTER event to the actor this TOUCH_BEGIN happened on.

So fix this embarrassing bug that caused touch input to break by also
picking to find an event-actor on TOUCH_BEGIN events.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1733>
2021-02-16 10:01:22 +01:00
Jonas Dreßler
734a185915 clutter: Only pick on motion or touch update events
Aside from ENTER/LEAVE, there are only two kinds of events that can move
the pointer, motion events and touch update events. Everything else
keeps the pointer at it's current position.

The reason we pick inside _clutter_process_event_details() is that we
want to set the event actor. Now if an event can't move the pointer, it
also can't change the event actor (well, it can subsequently by
triggering changes to the scenegraph, but that's handled elsewhere), so
there's no need to pick a new event actor when we get those events.
Instead, simply reuse the actor that's already associated with the
current input device as the event actor for non MOTION/TOUCH_UPDATE
events.

Events where a device or a touchpoint goes away (like DEVICE_REMOVED or
TOUCH_END/CANCEL) also affect picking, they don't need a repick, but
instead the actor associated with the device/touchpoint needs to be
unassociated. This is ensured by invoking remove_device_for_event() on
those events and will not be affected by this change.

This should improve performance while scrolling quite a bit, since
scroll events come in unthrottled and we now no longer do a repick on
each one of those.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1729>
2021-02-15 12:24:49 +00:00
Jonas Dreßler
d5b69d9cc0 clutter: Use event source directly for debug message
No need to assign things to a separate variable there, let's just read
event->any.source directly instead.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1729>
2021-02-15 12:24:49 +00:00
Daniel van Vugt
7e32c4196e clutter/stage-view: Reimplement CLUTTER_SHOW_FPS
Since a9a9a0d1c5 it didn't print anything. Now we reimplement it to
show FPS to a higher precision than in 3.36, add update/render times,
and separate stats per view/CRTC.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/154>
2021-02-15 08:42:18 +00:00
Jonas Ådahl
4145fbbae4 clutter/timeline: Clear stage view listener when actor destroyed
We might have a stage view listener attached to the stage itself if the
actor didn't have a suitable frame clock when the actor was associated
with the timeline. We'd then listen to stage-views-changed signals on
the stage itself to be able to attach to a frame clock when one
appeared.

What went wrong is that if an actor that didn't have a frameclock was
associated with a timeline, but then destroyed, the timeline would
disassociate itself from the actor, but it'd still listen on the
stage-views-changed signal on the stage. This would be in itself
harmless, until the timeline itself is destroyed, as at this point, it
wouldn't clean up the stage-views-changed listener on the stage, as it's
assumed to only be valid when there is an actor attached.

Fix this issue by cleaning up the stage's stage-views-changed listener
when the actor is destroyed, as we wouldn't be able to make use of it by
then anyway.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3323
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1719>
2021-02-08 19:40:05 +00:00
Ivan Molodetskikh
34a9e6a8f8 clutter/frame-clock: Fix presentation time alignment
Before this commit, next presentation time could end up behind now_us or
ahead of now_us depending on how presentation times happened to be
aligned relative to integer multiples of refresh_interval_us. It's not
clear whether this was originally intended because even if it the next
presentation time ends up behind now_us, it is moved ahead by a while
loop down below in this function.

Even though this difference in behavior didn't really matter, it made
reasoning about the subsequent branches more complex. It would also
potentially introduce bugs if the logic was to be modified. So this
commit makes it so next presentation time is always ahead of now_us.

It also adds a comment with a graph detailing the computations, and
adjusts the variable names to drop unfortunate terminology mistakes.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1707>
2021-02-05 17:05:19 +00:00
Ivan Molodetskikh
01b30ff9e4 clutter/frame-clock: Comment presentation time skip
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1707>
2021-02-05 17:05:19 +00:00
Ivan Molodetskikh
ed93a11de6 clutter/frame-clock: Comment common case of next presentation time
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1707>
2021-02-05 17:05:19 +00:00
Ivan Molodetskikh
bc7c56fa74 clutter/frame-clock: Always update last presentation time
Last presentation time is mainly used to make sure predicted
presentation time is aligned with display refreshes. Even if it went
back in time, there will be no issue as next presentation time takes
current time into account. Synthetic presentation time is not exactly
aligned with display refreshes, so using it would only result in
inconsistent animations.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1707>
2021-02-05 17:05:19 +00:00
Ivan Molodetskikh
8bdad733ca clutter/frame-clock: Fix typo
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1707>
2021-02-05 17:05:19 +00:00
Ivan Molodetskikh
dae089f79e clutter: Remove CLUTTER_ENABLE_EXPERIMENTAL_API
It is no longer used anywhere.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1707>
2021-02-05 17:05:19 +00:00
Ivan Molodetskikh
33d91937cf clutter/stage: Remove sync_delay
It is not accessed anywhere.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1707>
2021-02-05 17:05:19 +00:00
Ivan Molodetskikh
9b44aa77b6 clutter: Remove clutter_stage_set_sync_delay
The sync_delay field is never accessed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1707>
2021-02-05 17:05:19 +00:00
Ivan Molodetskikh
f97d2c5f67 clutter: Remove clutter_stage_skip_sync_delay declaration
It wasn't defined or used anywhere.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1707>
2021-02-05 17:05:19 +00:00
Jonas Ådahl
5104a9b2ce remote-desktop/session: Add support for SelectionTransfer/Write
When a transfer request is done to the MetaSelectionSourceRemote source,
it's translated to a SelectionTransfer signal, which the remote desktop
server is supposed to respond to with SelectionWrite.

A timeout (set to 15 seconds) is added to handle too long timeouts,
which cancels the transfer request.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1552>
2021-02-05 16:44:27 +00:00
Jonas Ådahl
30e1c51b33 Change all g_memdup() to g_memdup2()
Using g_memdup() is dangerous due to the type of the size argument. See
https://gitlab.gnome.org/GNOME/glib/-/issues/2319 and
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1926 for details.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1708>
2021-02-04 19:16:28 +01:00
Daniel van Vugt
41bf0181b9 clutter/offscreen-effect: Set the viewport correctly
Previously we were setting the FBO's viewport to be the same dimensions as
the stage itself for compatibility. This works for most cases, but not if
the actor is larger than the stage. In that case it could cause excessive
clipping if the actor's transformed screen position was negative, which
is seen in https://gitlab.gnome.org/GNOME/gnome-shell/issues/2087

Also if a small actor paints to its negative dimensions (like a box-shadow)
then we might be missing those pixels on the left or top, even though
they're inside the paint volume.

Now we set the viewport dimensions to match the area we're actually
rendering so the FBO contents are never over or under clipped.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3068

Although if you try using shadows larger than that (like in
gnome-shell#1090) then you will also need gnome-shell!1417.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1053>
2021-02-02 09:42:56 +00:00
Daniel van Vugt
f887b02714 clutter/offscreen-effect: Unscale first, then translate the FBO texture
We had been doing it backwards as far back as e3966882e8 which meant
that we were translating by `fbo_offset / resource_scale` stage units
instead of just `fbo_offset`.

Because `fbo_offset` is in stage units already, it's not scaled and so
needs to be applied after the unscaling from texels to stage units.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1053>
2021-02-02 09:42:56 +00:00
Carlos Garnacho
d1c62d882a clutter: Do not read settings from ini file
We've inherited, and still keep in place, code that reads ini files
at ~/.config/clutter-1.0/settings.ini and /etc/clutter-1.0/settings.ini
to tweak different aspects of Clutter.

Some of these should use GSettings instead, some others are exposed
nowadays differently for our purposes (e.g. envvars, looking glass, ...).
Overall seems like an unexpected entry point nowadays, so remove the
parsing of these .ini files altogether.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1693>
2021-01-28 23:09:56 +01:00
Carlos Garnacho
2113eccd47 clutter: Load mouse related ClutterSettings properties from GSettings
These are forgotten here, leaving clutter with the builtin defaults.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1693>
2021-01-28 23:09:55 +01:00
Jonas Ådahl
1d4e535e7a clutter/stage: Remove 'paint' argument in capture_into()
There are more suitable API when the stage needs to be actually painted
into something. Nothing actually used this anymore too, so remove this
functionality.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1689>
2021-01-28 20:05:23 +00:00
Jonas Ådahl
92a0b16675 stage/cogl: Don't finish offscreen at end of paint
It'll "finish" implicitly whenever accessed, so we don't need to do
anything here.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1689>
2021-01-28 20:05:23 +00:00
Daniel van Vugt
ad65de3790 clutter/stage-cogl: Clamp queued_redraw_clip if in use
If we are about to replace `redraw_clip` with a clamped version of itself
then we may as well do the same for `queued_redraw_clip`, so you can see
more precisely what the damage of the current frame is.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1554>
2021-01-27 17:17:44 +08:00
Daniel van Vugt
456f80022a clutter/stage-cogl: Remove unnecessary variable: fb_damage
We no longer have use for a different value to fb_clip_region, so
fb_damage no longer needs to exist.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1554>
2021-01-27 17:17:36 +08:00
Daniel van Vugt
88600c8985 clutter/stage-cogl: Ensure redraw_clip is a superset of fb_clip_region
Initially we generate the new part of fb_clip_region from the new part
of redraw_clip, scale it up and clamp. But the clamping means the new
part of fb_clip_region might now represent a slightly larger area than
the new part of redraw_clip, by one pixel.

In some rare cases where a foreground actor honours redraw_clip, but
the background actor does not (meaning it might fill all fb_clip_region),
you could find 1px rendering glitches in that gap as the background
actor paints there but the foreground actor does not.

To ensure such glitches can never happen we now regenerate the final
redraw_clip as a clamped superset of the final fb_clip_region. That's
the minimum area we must paint to ensure no gaps appear inside
fb_clip_region.

Although the fix here sounds like the intent of the old code, the old
code forgot to include the new part of fb_clip_region in the clamping
of the final redraw_clip. So the new part of redraw_clip was sometimes
kept too small for the new part of fb_clip_region.

We also move the code to the main path because technically it's also
needed when `has_buffer_age == FALSE`.

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1500
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1554>
2021-01-27 17:15:01 +08:00
Jonas Ådahl
c985753442 cursor-renderer/native: Update HW state during frames
Before each frame is maybe redrawn, push any new cursor KMS state to the
pending update. It'll then either be posted during the next page flip,
or when the same frame finishes, in case nothing was redrawn.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1488>
2021-01-22 16:47:08 +00:00
Jonas Ådahl
487ea0dd95 kms: Add symbolic page flips and cogl frame infos
This makes it possible to post a symbolic page flip and frame callback,
meant to be used by immediate symbolic page flip reply when emulating
cursor plane changes using legacy drmMode* functions.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1488>
2021-01-22 16:47:08 +00:00