xwayland: Do not queue frame callbacks unconditionally

The removed comment is not longer true: XWayland schedules its VSYNC
from frame callbacks nowadays. Only sending callbacks when the surface
actor is unobscured makes XWayland throttle its VSYNC to 1/sec,
reducing repaints in many cases.

Follow up of https://gitlab.gnome.org/GNOME/mutter/merge_requests/918

https://gitlab.gnome.org/GNOME/mutter/merge_requests/956
This commit is contained in:
Robert Mader 2019-12-04 18:54:42 +01:00
parent 0d1c18a4ce
commit 96e1883361

View File

@ -872,31 +872,6 @@ xwayland_surface_assigned (MetaWaylandSurfaceRole *surface_role)
surface_role_class->assigned (surface_role);
}
static void
xwayland_surface_commit (MetaWaylandSurfaceRole *surface_role,
MetaWaylandPendingState *pending)
{
MetaWaylandSurface *surface =
meta_wayland_surface_role_get_surface (surface_role);
MetaWaylandSurfaceRoleClass *surface_role_class =
META_WAYLAND_SURFACE_ROLE_CLASS (meta_wayland_surface_role_xwayland_parent_class);
/* For Xwayland windows, throttling frames when the window isn't actually
* drawn is less useful, because Xwayland still has to do the drawing sent
* from the application - the throttling would only be of sending us damage
* messages, so we simplify and send frame callbacks after the next paint of
* the screen, whether the window was drawn or not.
*
* Currently it may take a few frames before we draw the window, for not
* completely understood reasons, and in that case, not thottling frame
* callbacks to drawing has the happy side effect that we avoid showing the
* user the initial black frame from when the window is mapped empty.
*/
meta_wayland_surface_queue_pending_state_frame_callbacks (surface, pending);
surface_role_class->commit (surface_role, pending);
}
static MetaWaylandSurface *
xwayland_surface_get_toplevel (MetaWaylandSurfaceRole *surface_role)
{
@ -961,7 +936,6 @@ meta_wayland_surface_role_xwayland_class_init (MetaWaylandSurfaceRoleXWaylandCla
object_class->finalize = xwayland_surface_finalize;
surface_role_class->assigned = xwayland_surface_assigned;
surface_role_class->commit = xwayland_surface_commit;
surface_role_class->get_toplevel = xwayland_surface_get_toplevel;
actor_surface_class->get_geometry_scale = xwayland_surface_get_geometry_scale;