Skip to content

Commit

Permalink
Ignore fold change events for other display ids
Browse files Browse the repository at this point in the history
Scrcpy mirrors a specific display id, it must ignore events for other
display ids.

Fixes #4120 <#4120>
  • Loading branch information
rom1v committed Jun 27, 2023
1 parent 0049b3c commit 808bd14
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/src/main/java/com/genymobile/scrcpy/Device.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ public void onRotationChanged(int rotation) {
ServiceManager.getWindowManager().registerDisplayFoldListener(new IDisplayFoldListener.Stub() {
@Override
public void onDisplayFoldChanged(int displayId, boolean folded) {
if (Device.this.displayId != displayId) {
// Ignore events related to other display ids
return;
}

synchronized (Device.this) {
DisplayInfo displayInfo = ServiceManager.getDisplayManager().getDisplayInfo(displayId);
if (displayInfo == null) {
Expand Down

0 comments on commit 808bd14

Please sign in to comment.