forked from 12to11/12to11
Fix subsurface commit behavior
* subsurface.c (EarlyCommit): Clear pending_commit after merging cached state. * tests/subsurface_test.c (test_single_step): Add test that found this problem.
This commit is contained in:
parent
769827921f
commit
3dcceb506b
2 changed files with 27 additions and 4 deletions
13
subsurface.c
13
subsurface.c
|
@ -592,10 +592,15 @@ EarlyCommit (Surface *surface, Role *role)
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
else if (subsurface->pending_commit)
|
else if (subsurface->pending_commit)
|
||||||
/* There is still pending state. Merge the state into the surface
|
{
|
||||||
first, before SubcompositorUpdate is called by
|
/* There is still cached state. Merge the state into the
|
||||||
InternalCommit. */
|
surface first, before SubcompositorUpdate is called by
|
||||||
XLSurfaceMergeCachedState (surface);
|
InternalCommit. */
|
||||||
|
XLSurfaceMergeCachedState (surface);
|
||||||
|
|
||||||
|
/* As the state is merged, there is no more cached state. */
|
||||||
|
subsurface->pending_commit = False;
|
||||||
|
}
|
||||||
|
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
|
@ -685,6 +685,24 @@ test_single_step (enum test_kind kind)
|
||||||
WL_OUTPUT_TRANSFORM_90);
|
WL_OUTPUT_TRANSFORM_90);
|
||||||
wait_frame_callback (subsurfaces[8]->surface);
|
wait_frame_callback (subsurfaces[8]->surface);
|
||||||
sleep_or_verify ();
|
sleep_or_verify ();
|
||||||
|
|
||||||
|
/* Now, attach subsurface_1.png in subsurfaces[7]. Nothing
|
||||||
|
should be displayed. */
|
||||||
|
wl_surface_attach (subsurfaces[7]->surface, subsurface_1_png,
|
||||||
|
0, 0);
|
||||||
|
wl_surface_damage (subsurfaces[7]->surface, 0, 0, 256, 256);
|
||||||
|
wl_surface_commit (subsurfaces[7]->surface);
|
||||||
|
|
||||||
|
/* Also move the subsurface a little. */
|
||||||
|
wl_subsurface_set_position (subsurfaces[7]->subsurface, 100, 100);
|
||||||
|
|
||||||
|
wait_frame_callback (wayland_surface);
|
||||||
|
sleep_or_verify ();
|
||||||
|
|
||||||
|
/* Commit subsurfaces[6]. As it is now desynchronous,
|
||||||
|
subsurface_1.png should be displayed. */
|
||||||
|
wait_frame_callback (subsurfaces[6]->surface);
|
||||||
|
sleep_or_verify ();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue