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

Doesn't sync correctly after use adb shell wm size. #1918

Open
2 tasks done
Sodium-Aluminate opened this issue Nov 19, 2020 · 5 comments · May be fixed by #4469
Open
2 tasks done

Doesn't sync correctly after use adb shell wm size. #1918

Sodium-Aluminate opened this issue Nov 19, 2020 · 5 comments · May be fixed by #4469

Comments

@Sodium-Aluminate
Copy link

  • I have read the FAQ.
  • I have searched in existing issues.

Environment

  • OS: Ubuntu 18.04
  • scrcpy version: 1.14
  • installation method: apt
  • device model: Redmi note 8 pro (begonia) <- 1080x2336 default.
  • Android version: 10

Describe the bug

  1. start scrcpy
  2. run adb shell wm size 1080x2336 or adb shell wm size 1080x1920
  3. scrcpy stdout nothing and the copied screen was not fully displayed.

terminal 1(scrcpy):

sodiumaluminate@AlsPad:~$ scrcpy
INFO: scrcpy 1.14 <https://github.com/Genymobile/scrcpy>
/usr/local/share/scrcpy/scrcpy-server:...shed. 5.7 MB/s (33142 bytes in 0.006s)
[server] INFO: Device: Xiaomi Redmi Note 8 Pro (Android 10)
INFO: OpenGL shaders: ENABLED
INFO: Created renderer: opengl
INFO: Renderer: opengl
INFO: OpenGL version: 4.6.0 NVIDIA 450.80.02
INFO: Trilinear filtering enabled
INFO: Initial texture: 1080x2336
^CWARN: Device disconnected
sodiumaluminate@AlsPad:~$ 

terminal 2(adb wm):

sodiumaluminate@AlsPad:~$ adb shell 
begonia:/ $ wm 
Window manager (window) commands:
  help
      Print this help text.
  size [reset|WxH|WdpxHdp] [-d DISPLAY_ID]
    Return or override display size.
    width and height in pixels unless suffixed with 'dp'.
  density [reset|DENSITY] [-d DISPLAY_ID]
    Return or override display density.
  folded-area [reset|LEFT,TOP,RIGHT,BOTTOM]
    Return or override folded area.
  overscan [reset|LEFT,TOP,RIGHT,BOTTOM] [-d DISPLAY ID]
    Set overscan area for display.
  scaling [off|auto] [-d DISPLAY_ID]
    Set display scaling mode.
  dismiss-keyguard
    Dismiss the keyguard, prompting user for auth if necessary.
  set-user-rotation [free|lock] [-d DISPLAY_ID] [rotation]
    Set user rotation mode and user rotation.
  set-fix-to-user-rotation [-d DISPLAY_ID] [enabled|disabled]
    Enable or disable rotating display for app requested orientation.
255|begonia:/ $ wm size 1080x1920                                                                                                                    
begonia:/ $ wm size reset                                                                                                                            
begonia:/ $ wm size 1080x1920                                                                                                                        
begonia:/ $ wm size reset                                                
begonia:/ $ 
@Sodium-Aluminate Sodium-Aluminate changed the title doesn't sync correctly after use adb shell wm size. Doesn't sync correctly after use adb shell wm size. Nov 19, 2020
@rom1v
Copy link
Collaborator

rom1v commented Nov 19, 2020

But if you restart scrcpy, does it have the correct size?

AFAIK there is no way to be notified of window size changes.

@Sodium-Aluminate
Copy link
Author

But if you restart scrcpy, does it have the correct size?

yes, it can be corrected by restart scrcpy.

AFAIK there is no way to be notified of window size changes.

but maybe we can check it evey few seconds?

@rom1v
Copy link
Collaborator

rom1v commented Nov 19, 2020

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.

@Sodium-Aluminate
Copy link
Author

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.

@yume-chan yume-chan linked a pull request Nov 27, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants