-
-
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
Doesn't sync correctly after use adb shell wm size. #1918
Comments
But if you restart scrcpy, does it have the correct size? AFAIK there is no way to be notified of window size changes. |
yes, it can be corrected by restart scrcpy.
but maybe we can check it evey few seconds? |
Polling is ugly, it's not worth it for a thing which almost never happens in practice. If there is a proper way to be notified by a callback, I'll add it, but no polling. |
well… you are right, unless we hook the wm or adb, or create an Android activity in front end, there may be no way to watch it. |
Refs:
EDIT: no, this method is related to picture-in-picture, it is not triggered when the device resolution changes. |
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
adb shell wm size 1080x2336
oradb shell wm size 1080x1920
terminal 1(scrcpy):
terminal 2(adb wm):
The text was updated successfully, but these errors were encountered: