Added adaptive virtual display that adjusts to window size

This commit is contained in:
Tinura Dinith 2026-03-05 02:15:28 +05:30
parent 3fcc177da5
commit 52709d60ba
12 changed files with 308 additions and 8 deletions

View file

@ -182,6 +182,11 @@ sc_control_msg_serialize(const struct sc_control_msg *msg, uint8_t *buf) {
size_t len = write_string_tiny(&buf[1], msg->start_app.name, 255);
return 1 + len;
}
case SC_CONTROL_MSG_TYPE_SET_DISPLAY_SIZE:
sc_write16be(&buf[1], msg->set_display_size.width);
sc_write16be(&buf[3], msg->set_display_size.height);
sc_write16be(&buf[5], msg->set_display_size.dpi);
return 7;
case SC_CONTROL_MSG_TYPE_EXPAND_NOTIFICATION_PANEL:
case SC_CONTROL_MSG_TYPE_EXPAND_SETTINGS_PANEL:
case SC_CONTROL_MSG_TYPE_COLLAPSE_PANELS:
@ -315,6 +320,12 @@ sc_control_msg_log(const struct sc_control_msg *msg) {
case SC_CONTROL_MSG_TYPE_START_APP:
LOG_CMSG("start app \"%s\"", msg->start_app.name);
break;
case SC_CONTROL_MSG_TYPE_SET_DISPLAY_SIZE:
LOG_CMSG("set display size %ux%u/%u",
msg->set_display_size.width,
msg->set_display_size.height,
msg->set_display_size.dpi);
break;
case SC_CONTROL_MSG_TYPE_RESET_VIDEO:
LOG_CMSG("reset video");
break;