Skip to content

Commit f9b0c51

Browse files
committed
fw/services/compositor: handle deferred app render during modal transitions
When transitioning to a modal, cancel any deferred app render since the modal will cover the app framebuffer. Release the app framebuffer to inform the app that the render is complete. Co-authored-by: Claude <[email protected]> Signed-off-by: Joseph Mearman <[email protected]>
1 parent 6fa318e commit f9b0c51

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

src/fw/services/common/compositor/compositor.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,13 @@ void compositor_transition(const CompositorTransition *compositor_animation) {
413413
}
414414

415415
if (!prv_should_render() || s_deferred_render.animation.pending) {
416-
if (s_deferred_render.app.pending) {
416+
// If we're transitioning to a modal, cancel any deferred app render since the modal
417+
// will cover the app framebuffer. Release the app framebuffer to inform the app
418+
// that the render is complete.
419+
const ModalProperty properties = modal_manager_get_properties();
420+
const bool is_modal_existing = (properties & ModalProperty_Exists);
421+
const bool is_modal_transparent = (properties & ModalProperty_Transparent);
422+
if (is_modal_existing && !is_modal_transparent && s_deferred_render.app.pending) {
417423
s_deferred_render.app.pending = false;
418424
prv_release_app_framebuffer();
419425
}
@@ -460,6 +466,15 @@ void compositor_transition(const CompositorTransition *compositor_animation) {
460466

461467
// We can start animating immediately if we're going to a modal window. This is because
462468
// modal window content is drawn on demand so it's always available.
469+
470+
// When transitioning to a modal, cancel any deferred app render since the modal
471+
// will cover the app framebuffer. Release the app framebuffer to inform the app
472+
// that the render is complete. Only do this if there's actually a deferred render.
473+
if (s_deferred_render.app.pending) {
474+
s_deferred_render.app.pending = false;
475+
prv_release_app_framebuffer();
476+
}
477+
463478
if (compositor_animation) {
464479
s_state = CompositorState_Transitioning;
465480
animation_schedule(s_animation_state.animation);

tests/fakes/fake_HCIAPI.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
// BD_ADDR_t is typically a pointer to uint8_t or uint8_t array
1616
// This helper converts BTDeviceAddress to the expected format
17-
static const uint8_t *BTDeviceAddressToBDADDR(BTDeviceAddress addr) {
17+
static const uint8_t *prv_addr_to_bdaddr(BTDeviceAddress addr) {
1818
return addr.octets;
1919
}
2020

0 commit comments

Comments
 (0)