diff --git a/server/src/main/java/com/genymobile/scrcpy/video/ScreenCapture.java b/server/src/main/java/com/genymobile/scrcpy/video/ScreenCapture.java index 31d27c55b9..c477144a00 100644 --- a/server/src/main/java/com/genymobile/scrcpy/video/ScreenCapture.java +++ b/server/src/main/java/com/genymobile/scrcpy/video/ScreenCapture.java @@ -138,8 +138,9 @@ public void start(Surface surface) { .createVirtualDisplay("scrcpy", videoSize.getWidth(), videoSize.getHeight(), displayId, surface); } else { // density doesn't matter since this virtual display is only used for mirroring - virtualDisplay.resize(videoSize.getWidth(), videoSize.getHeight(), 1); virtualDisplay.setSurface(surface); + virtualDisplay.resize(videoSize.getWidth(), videoSize.getHeight(), 1); + } virtualDisplayId = virtualDisplay.getDisplay().getDisplayId(); Rect contentRect = new Rect(0, 0, videoSize.getWidth(), videoSize.getHeight());