Merge pull request #7829 from FoamyGuy/multi_display_group_in_use

only add circuitpython_splash to display if it's not in another group
This commit is contained in:
Scott Shawcroft 2023-04-05 09:19:03 -07:00 committed by GitHub
commit 34a525add7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -136,7 +136,9 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self,
// Set the group after initialization otherwise we may send pixels while we delay in
// initialization.
common_hal_displayio_display_set_root_group(self, &circuitpython_splash);
if (!circuitpython_splash.in_group) {
common_hal_displayio_display_set_root_group(self, &circuitpython_splash);
}
common_hal_displayio_display_set_auto_refresh(self, auto_refresh);
}
@ -437,7 +439,9 @@ void reset_display(displayio_display_obj_t *self) {
circuitpython_splash.x = 0; // reset position in case someone moved it.
circuitpython_splash.y = 0;
supervisor_start_terminal(self->core.width, self->core.height);
common_hal_displayio_display_set_root_group(self, &circuitpython_splash);
if (!circuitpython_splash.in_group) {
common_hal_displayio_display_set_root_group(self, &circuitpython_splash);
}
}
void displayio_display_collect_ptrs(displayio_display_obj_t *self) {