Implement device screen off while mirroring

Add two shortcuts:
 - Ctrl+o to turn the device screen off while mirroring
 - Ctrl+Shift+o to turn it back on

On power on (either via the POWER key or BACK while screen is off), both
the device screen and the mirror are turned on.

<https://github.com/Genymobile/scrcpy/issues/175>
This commit is contained in:
Romain Vimont
2019-03-15 20:23:30 +01:00
parent 3ee9560ece
commit 12a3bb25d3
12 changed files with 144 additions and 3 deletions

View File

@@ -55,6 +55,9 @@ control_msg_serialize(const struct control_msg *msg, unsigned char *buf) {
&buf[1]);
return 1 + len;
}
case CONTROL_MSG_TYPE_SET_SCREEN_POWER_MODE:
buf[1] = msg->set_screen_power_mode.mode;
return 2;
case CONTROL_MSG_TYPE_BACK_OR_SCREEN_ON:
case CONTROL_MSG_TYPE_EXPAND_NOTIFICATION_PANEL:
case CONTROL_MSG_TYPE_COLLAPSE_NOTIFICATION_PANEL: