wayland: Drive frame callbacks from stage updates

Don't tie frame callbacks to actor painting, as it may end up in
situations where we miss sending frame callbacks when we should have. An
example of this is when a surface is partially off screen, and then
reports damage that is fully off screen. When this happen, we are likely
not to repaint anything, thus we won't send any frame callbacks even
though it's "suitable" for rendering again, as the surface is not on a
separate workspace or fully obscured.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/817
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1152

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1218
This commit is contained in:
Jonas Ådahl
2020-04-27 15:43:19 +02:00
parent e8b09df8d2
commit 066bc5986d
14 changed files with 123 additions and 150 deletions

View File

@ -23,6 +23,7 @@
#include "backends/meta-logical-monitor.h"
#include "compositor/meta-feedback-actor-private.h"
#include "wayland/meta-wayland.h"
struct _MetaWaylandSurfaceRoleDND
{
@ -42,7 +43,11 @@ dnd_surface_assigned (MetaWaylandSurfaceRole *surface_role)
MetaWaylandSurface *surface =
meta_wayland_surface_role_get_surface (surface_role);
meta_wayland_surface_queue_pending_frame_callbacks (surface);
if (wl_list_empty (&surface->unassigned.pending_frame_callback_list))
return;
meta_wayland_compositor_add_frame_callback_surface (surface->compositor,
surface);
}
static void
@ -56,7 +61,8 @@ dnd_surface_apply_state (MetaWaylandSurfaceRole *surface_role,
MetaWaylandSurfaceRoleClass *surface_role_class =
META_WAYLAND_SURFACE_ROLE_CLASS (meta_wayland_surface_role_dnd_parent_class);
meta_wayland_surface_queue_pending_state_frame_callbacks (surface, pending);
meta_wayland_compositor_add_frame_callback_surface (surface->compositor,
surface);
surface_role_dnd->pending_offset_x = pending->dx;
surface_role_dnd->pending_offset_y = pending->dy;