From 122f6c12bef126045470610a6a63e797b9d172a1 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Mon, 1 Mar 2021 20:11:09 +0100 Subject: [PATCH] fix(disp): lv_disp_drv_update set screen size manually Using lv_obj_set_size will trigger asserts as normally the size of the screens shouldn't be adjusted --- src/lv_hal/lv_hal_disp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lv_hal/lv_hal_disp.c b/src/lv_hal/lv_hal_disp.c index 14fa8baf2..28415a295 100644 --- a/src/lv_hal/lv_hal_disp.c +++ b/src/lv_hal/lv_hal_disp.c @@ -174,9 +174,15 @@ void lv_disp_drv_update(lv_disp_t * disp, lv_disp_drv_t * new_drv) { memcpy(&disp->driver, new_drv, sizeof(lv_disp_drv_t)); + lv_coord_t w = lv_disp_get_hor_res(disp); + lv_coord_t h = lv_disp_get_ver_res(disp); uint32_t i; for(i = 0; i < disp->screen_cnt; i++) { - lv_obj_set_size(disp->screens[i], lv_disp_get_hor_res(disp), lv_disp_get_ver_res(disp)); + lv_area_t prev_coords; + lv_obj_get_coords(disp->screens[i], &prev_coords); + disp->screens[i]->coords.x2 = w; + disp->screens[i]->coords.y2 = h; + lv_signal_send(disp->screens[i], LV_SIGNAL_COORD_CHG, &prev_coords); } /*