mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-03 22:58:51 +00:00
Improve manual rotation reliability
Manually requesting a device orientation change using MOD+r often fails. Introducing a small delay dramatically improves reliability.
This commit is contained in:
parent
0e2d084751
commit
eb004b010e
1 changed files with 4 additions and 0 deletions
|
@ -206,6 +206,10 @@ public final class Device {
|
||||||
|
|
||||||
// restore auto-rotate if necessary
|
// restore auto-rotate if necessary
|
||||||
if (accelerometerRotation) {
|
if (accelerometerRotation) {
|
||||||
|
if (displayId == 0) {
|
||||||
|
// HACK: rotation on the main display often fail on recent Android devices if thawRotation() is called immediately
|
||||||
|
SystemClock.sleep(10);
|
||||||
|
}
|
||||||
wm.thawRotation(displayId);
|
wm.thawRotation(displayId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue