-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scrcpy 2.1 uses main display's resolution for higher res secondary displays #4120
Comments
So it works as expected in scrcpy v2.0, but not v2.1? I'm surprised, because there was no change related to device display between 2.0 and 2.1… Could you please build the app from sources, and |
I can't reproduce with a simulated secondary display (enabled from developer options): $ scrcpy --list-displays
scrcpy 2.1 <https://github.com/Genymobile/scrcpy>
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 178.5 MB/s (56955 bytes in 0.000s)
[server] INFO: List of displays:
--display=0 (1440x3120)
--display=1 (3840x2160)
$ scrcpy --display=1
scrcpy 2.1 <https://github.com/Genymobile/scrcpy>
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 154.6 MB/s (56955 bytes in 0.000s)
[server] INFO: Device: [OnePlus] OnePlus GM1913 (Android 11)
[server] WARN: Display doesn't have FLAG_SUPPORTS_PROTECTED_BUFFERS flag, mirroring can be restricted
INFO: Renderer: opengl
INFO: OpenGL version: 4.6 (Compatibility Profile) Mesa 23.1.2-1
INFO: Trilinear filtering enabled
INFO: Texture: 3840x2160 |
I set mine up with |
I built it from source just now and can still reproduce it with git master, building 2.0 from source also fixes it. Will report back once I've bisected it. |
|
Yet, your device is not a foldable device, is it? Is this listener called:
You could add the following diff to check: diff --git a/server/src/main/java/com/genymobile/scrcpy/Device.java b/server/src/main/java/com/genymobile/scrcpy/Device.java
index f817a3ce2..e9da67421 100644
--- a/server/src/main/java/com/genymobile/scrcpy/Device.java
+++ b/server/src/main/java/com/genymobile/scrcpy/Device.java
@@ -103,6 +103,7 @@ public final class Device {
ServiceManager.getWindowManager().registerDisplayFoldListener(new IDisplayFoldListener.Stub() {
@Override
public void onDisplayFoldChanged(int displayId, boolean folded) {
+ Ln.i("==== onDisplayFoldChanged(" + displayId + ", " + folded + ")");
synchronized (Device.this) {
DisplayInfo displayInfo = ServiceManager.getDisplayManager().getDisplayInfo(displayId);
if (displayInfo == null) { |
No, my phone is not foldable, in fact I think it might just be old enough to be released before any folding phone was released to the public hehe... Applying the above patch on top of master outputs this when ran:
|
OK, so I guess we should ignore any call to |
I don't know any programming other than bash scripting, so I'll gladly leave it to someone who knows what they're doing. |
OK, will do (possibly this week). Thank you very much for your tests and bisect 😉 |
Please test branch |
Tested the |
👍 Thank you. Merged into |
Sorry, I didn't even see my PR was merged in 2.1, Thanks! Edit: I've tested your fix and it seems to work well :) |
Environment
Describe the bug
When using
--display
for a display with a higher resolution, it is still displayed with the main display's resolution, cutting off parts of the display. Setting the secondary display to have a lower resolution works as intended.scrcpy 2.0:
scrcpy 2.1:
The text was updated successfully, but these errors were encountered: