-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Support for automatically resizing between multiple displays #4152
Comments
Sorry I can't reproduce. It works with the latest version available on master, on a Samsung Z Fold 4. |
@Jnss98b Could you please add this little patch to help debugging this issue? diff --git a/server/src/main/java/com/genymobile/scrcpy/Device.java b/server/src/main/java/com/genymobile/scrcpy/Device.java
index f817a3ce..e9da6742 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) {
Thanks! |
Will test it tomorrow when I get back. Currently out of town at the moment |
@AdoPi Could you do me a favor and build a 64-bit windows release with the patch please? I'm having trouble building from source with msys2 |
@Jnss98b:
(to be replaced in your v2.1 release) |
Here's the log after I start scrcpy with the phone folded, unfolded it, and then folded it again
|
Any update on this? @AdoPi |
Does your window size change when you fold your phone or not at all? If possible for you, could you please try on Linux or Mac? I suspect it is an issue with the window and not with events sent from your device. |
Yeah it doesn't at all. Both when folding and unfolding
I could try it on linux. Does it matter if I test it on a VM? |
I think you can use a VM yes! |
Set up a ubuntu vm just to find out afterward that the latest packaged version for ubuntu is 1.25 lol fml |
Just tested with scrcpy 2.1.1 on ubuntu 22.0.4.3 lts and I can still reproduce the issue |
Looks like the window does resize automatically...but not in an intended way |
Thank you for your video! |
I can also reproduce the exact same behavior on scrcpy 2.1.1 on windows 11 22h2 too (on 2.1 the scrcpy window didn't resize automatically) MaeTwZjVpX.mp4 |
I guess rotating your screen doesnt work too? |
Actually, that works well haha. I've never had any issue with that, even with previous devices |
Also, the demos I did today were on a different pc from the one I first discovered the issue on so I suppose it's reproducible on multiple hosts? |
Changing display will cause the issue again tho Outer display Xg95ZTk5xR.mp4Inner display edited.mp4 |
Not sure if anything changed but on v2.1.1 it seems to handle changing between displays a little bit better but still isn't really ideal. The inner display size will always be limited by the width of the outer display regardless of what display is in use when scrcpy was launched with folding events. The one time the inner display will be full size is if scrcpy was started with the inner display in use and the screen wasn't folded at all. Starting scrcpy on the cover display: Cover.mp4Starting scrcpy from the inner display: Inner.mp4 |
Any movement on this by chance? I can also confirm the same exact issue with a Pixel Fold on macOS. |
Replace RotationWatcher and DisplayFoldListener by a single DisplayListener, which is notified whenever the display size or dpi changes. Still use the old mechanism specifically for Android 14, where DisplayListener may be broken (it is fixed in recent Android 14 upgrades), until we receive the first DisplayListener event (which proves that it works). Fixes #161 <#161> Fixes #1918 <#1918> Fixes #4152 <#4152> Refs #4469 <#4469> Co-authored-by: Simon Chan <[email protected]>
Replace RotationWatcher and DisplayFoldListener by a single DisplayListener, which is notified whenever the display size or dpi changes. Still use the old mechanism specifically for Android 14, where DisplayListener may be broken (it is fixed in recent Android 14 upgrades), until we receive the first DisplayListener event (which proves that it works). Fixes #161 <#161> Fixes #1918 <#1918> Fixes #4152 <#4152> Fixes #5362 comment <#5362 (comment)> Refs #4469 <#4469> Co-authored-by: Simon Chan <[email protected]>
Replace RotationWatcher and DisplayFoldListener by a single DisplayListener, which is notified whenever the display size or dpi changes. However, the DisplayListener mechanism is broken in the first versions of Android 14 (it is fixed in android-14.0.0_r29 by commit [1]), so continue to use the old mechanism specifically for Android 14 (where DisplayListener may be broken), until we receive the first "display changed" event (which proves that it works). [1]: <https://android.googlesource.com/platform/frameworks/base.git/+/5653c6b5875df599307c3e6bfae32fb2fc17ca1f%5E%21/> Fixes #161 <#161> Fixes #1918 <#1918> Fixes #4152 <#4152> Fixes #5362 comment <#5362 (comment)> Refs #4469 <#4469> PR #5415 <#5415> Co-authored-by: Simon Chan <[email protected]>
Environment
Describe the bug
Right now if I switch between displays on something like a foldable phone, the screen capture won't scale to the correct aspect ratio at all
Transitioning from the outer display to the inner display
Transitioning from the inner display to the outer display
The text was updated successfully, but these errors were encountered: