Skip to content
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 Foldable Devices #3960

Closed
nilvanlopes opened this issue Apr 30, 2023 · 7 comments
Closed

Support Foldable Devices #3960

nilvanlopes opened this issue Apr 30, 2023 · 7 comments

Comments

@nilvanlopes
Copy link

Is there any way to use scrcpy with a closed foldable device?
I use the Samsung Z Flip4, and with the Windows Phone Link app I can stream the phone's screen even when it's folded.
It would be great to use this with scrcpy as the stream quality is 10x better.
Maybe it's just me not knowing how to use the tool, but when I fold the phone it doesn't disconnect from scrcpy, it just gets a black screen.

@InstaZDLL
Copy link

I also have a Samsung Z Flip4 but the quality is good the problem must be elsewhere I think.

I have the same problem when I fold the phone the screen is black, I don't know if the--stay-awake argument can fix that, you should try.

@rom1v
Copy link
Collaborator

rom1v commented May 4, 2023

Is it different when you start scrcpy while the screen is closed or open?

@nilvanlopes
Copy link
Author

nilvanlopes commented May 4, 2023

@rom1v
If I run scrcpy while the phone is bent, the program just shows a black screen.
Like the phone is locked. And if I click to unlock, the secondary screen responds.

If I run scrcpy with the screen open, it opens normally, but if I fold the screen, the screen is black.

@InstaZDLL
Tried using --stay-awake, didn't work

The alternative i using is alt+o, but this don't let me fold the phone.

@AdoPi
Copy link
Contributor

AdoPi commented May 7, 2023

Hey I've just tried with a Galaxy Z Fold 4 and it works even if I bend the phone.
Something which doesn't work however is the window which can't adapt its size on the fly to fit the new screen resolution in use.

Note: I use the latest version of scrcpy directly built from source.

@nilvanlopes
Copy link
Author

nilvanlopes commented May 7, 2023

@AdoPi using Z flip 4.
You unfold the cell phone and run scrcpy and it shows the internal screen, and when you fold it it continues showing the internal screen? or does it show the external screen?
when i bend the phone scrcpy only shows a black screen.
image

@AdoPi
Copy link
Contributor

AdoPi commented May 7, 2023

Edit:
Could it be possible that this Z Flip phone uses the secure flag when it is folded the same way as some screen locker apps? In this case, it could be protected from recording.

On the Z Fold 4, everything works fine ( except the size of the window).
I can fold, unfold the phone and scrcpy shows the new display on the fly.

@AdoPi
Copy link
Contributor

AdoPi commented May 7, 2023

Hey I've just tried with a Galaxy Z Fold 4 and it works even if I bend the phone. Something which doesn't work however is the window which can't adapt its size on the fly to fit the new screen resolution in use.

Note: I use the latest version of scrcpy directly built from source.

Ok I have a POC which fixes the window size when the phone is folding, I'm going to open a PR 😄

rom1v pushed a commit that referenced this issue May 29, 2023
Handle folding event the same way as rotation events.

Fixes #3960 <#3960>
PR #3979 <#3979>

Signed-off-by: Romain Vimont <[email protected]>
@rom1v rom1v closed this as completed in 24999d0 Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants