wayland: Queue a redraw after showing the stage

On the other backends we will get some sort of expose event after
showing the stage's window which will queue a redraw. These expose
events don't exist on Wayland so nothing will cause Clutter to queue a
redraw. Weston doesn't bother displaying anything for the stage's
surface until the first buffer is sent, which of course it will never
receive if Clutter doesn't paint anything. This patch just makes it
explicitly queue a redraw after the stage is shown so that we will
always pass at least one frame to the compositor.

The bug can be seen by running test-stage-sizing. That example doesn't
have any animations so it won't try to queue any redraws until
something interacts with it. On the other hand something like
test-actors works fine without the patch because it constantly queues
redraws anyway in order to display the animation.

https://bugzilla.gnome.org/show_bug.cgi?id=696791
This commit is contained in:
Neil Roberts 2013-03-28 15:30:50 +00:00
parent 23707ac242
commit d5896d284e

View File

@ -129,6 +129,22 @@ clutter_stage_wayland_realize (ClutterStageWindow *stage_window)
return TRUE; return TRUE;
} }
static void
clutter_stage_wayland_show (ClutterStageWindow *stage_window,
gboolean do_raise)
{
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
clutter_stage_window_parent_iface->show (stage_window, do_raise);
/* We need to queue a redraw after the stage is shown because all of
* the other queue redraws up to this point will have been ignored
* because the actor was not visible. The other backends do not need
* to do this because they will get expose events at some point, but
* that does not happen for Wayland. */
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage_cogl->wrapper));
}
static void static void
clutter_stage_wayland_set_fullscreen (ClutterStageWindow *stage_window, clutter_stage_wayland_set_fullscreen (ClutterStageWindow *stage_window,
gboolean fullscreen) gboolean fullscreen)
@ -203,6 +219,7 @@ clutter_stage_window_iface_init (ClutterStageWindowIface *iface)
clutter_stage_window_parent_iface = g_type_interface_peek_parent (iface); clutter_stage_window_parent_iface = g_type_interface_peek_parent (iface);
iface->realize = clutter_stage_wayland_realize; iface->realize = clutter_stage_wayland_realize;
iface->show = clutter_stage_wayland_show;
iface->set_fullscreen = clutter_stage_wayland_set_fullscreen; iface->set_fullscreen = clutter_stage_wayland_set_fullscreen;
iface->resize = clutter_stage_wayland_resize; iface->resize = clutter_stage_wayland_resize;
} }