Change the display size of the simulator on vscode

Description

I unable to change the simulator’s display size properly.

What MCU/Processor/Board and compiler are you using?

I am using VScode on Ubuntu.

What LVGL version are you using?

I believe I am using LVGL 8.0.0. I followed the GitHub guide provided in the documentation: GitHub - lvgl/lv_sim_vscode_sdl

What do you want to achieve?

I would like to change the resolution of the simulator to a smaller size e.g. 480*320

What have you tried so far?

I am able to change the display size by removing the variables “MONITOR_HOR_RES” and “MONITOR_VER_RES” on line #348 and replacing it with the values I want of “lv_sim_vscode_sdl/lv_drivers/display/monitor.c”. However, I am unable to locate where these variables were called as changing the variables “MONITOR_HOR_RES” and “MONITOR_VER_RES” on lines #90 and #91 in “lv_sim_vscode_sdl/lv_drv_conf.h” do not affect the display’s size.

It definitively are the two definitions you mentioned inside lv_drv_conf.h. I’ve just checked and successfully built the demo app with two different screen sizes.

My guess is that you need a clean rebuild after changing the values. For some reason make doesn’t seem to create a dependency upon the lv_drv_conf.h file and changes to it don’t lead to proper recompiles.

Thank you for your help! You have solved my problem.

Here are the steps to resizing the simulator’s display for future reference:

  1. Edit the values of the variables “MONITOR_HOR_RES” and “MONITOR_VER_RES” on lines #90 and #91 in “lv_sim_vscode_sdl/lv_drv_conf.h”
  2. Type “sudo make clean” in the VScode terminal.
  3. Run the debugger.