Skip to content

Commit

Permalink
Power on the device only for main display
Browse files Browse the repository at this point in the history
Power on the device on start only if scrcpy is mirroring the main
display.
  • Loading branch information
rom1v committed Nov 2, 2024
1 parent 3ac4b64 commit f08a6d8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private void initPointers() {

private void control() throws IOException {
// on start, power on the device
if (powerOn && displayId != Device.DISPLAY_ID_NONE && !Device.isScreenOn()) {
if (powerOn && displayId == 0 && !Device.isScreenOn()) {
Device.pressReleaseKeycode(KeyEvent.KEYCODE_POWER, displayId, Device.INJECT_MODE_ASYNC);

// dirty hack
Expand Down

0 comments on commit f08a6d8

Please sign in to comment.