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

[Clipboard] copy/paste outside scrcpy got truncated #1580

Closed
2 tasks done
quangkieu opened this issue Jul 9, 2020 · 13 comments
Closed
2 tasks done

[Clipboard] copy/paste outside scrcpy got truncated #1580

quangkieu opened this issue Jul 9, 2020 · 13 comments

Comments

@quangkieu
Copy link

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

Environment

  • OS: Window 10 20H2 build 19042.330
  • scrcpy version: [1.14]
  • installation method: [choco]
  • device model: Samsung Note 10
  • Android version: [Android 10]

Describe the bug
A clear and concise description of what the bug is.

So this bug is when I copy/paste between programs outside of scrcpy but scrcpy is running in background
So I copy big text between vscode sessions, not copy to/from scrcpy but my text would be truncated at 4093 characters.
I suspect scrcpy keep reading clipboard and replace clipboard with what it see.

  • I would suggest to only read clipboard on Ctrl[+Shift]+V when scrcpy is in focus
  • Optional: Extend the clipboard length more than 4093
    Below are my console log, the 2>&1 is for redirect all error to output pipe so you could ignore it
    In below case, I only did one copy/paste operation but scrcpy keep coping forever

On errors, please provide the output of the console (and adb logcat if relevant).

PS> scrcpy -Sw 2>&1
scrcpy : INFO: scrcpy 1.14 <https://github.com/Genymobile/scrcpy>
At line:1 char:1
+ scrcpy -Sw 2>&1
+ ~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (INFO: scrcpy 1....ymobile/scrcpy>:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

C:\ProgramData\chocolatey\lib\scrcpy\tools\scrcpy-server: 1 file pushed, 0 skipped. 19.1 MB/s (33142 bytes in 0.002s)
[server] INFO: Device: samsung SM-N970U1 (Android 10)
INFO: Created renderer: direct3d
INFO: Renderer: direct3d
INFO: Initial texture: 1080x2280
ERROR: SDL failed to get a vertex buffer for this Direct3D 9 rendering batch!
ERROR: Dropping back to a slower method.
ERROR: This might be a brief hiccup, but if performance is bad, this is probably why.
ERROR: This error will not be logged again for this renderer.
[server] INFO: Device screen turned off
INFO: Device clipboard copied
INFO: Device clipboard copied
INFO: Device clipboard copied
INFO: Device clipboard copied
INFO: Device clipboard copied
INFO: Device clipboard copied
INFO: Device clipboard copied
INFO: Device clipboard copied
INFO: Device clipboard copied
INFO: Device clipboard copied
INFO: Device clipboard copied
INFO: Device clipboard copied
INFO: Device clipboard copied
INFO: Device clipboard copied

Please do not post screenshots of your terminal, just post the content as text instead.

@rom1v
Copy link
Collaborator

rom1v commented Jul 9, 2020

So this bug is when I copy/paste between programs outside of scrcpy but scrcpy is running in background
So I copy big text between vscode sessions, not copy to/from scrcpy but my text would be truncated at 4093 characters.

This is very weird. So you copy-paste from a desktop application to another desktop application, which do not involve the device?
I cannot reproduce (on Linux).

I suspect scrcpy keep reading clipboard and replace clipboard with what it see.

Only in one direction: if the device clipboard is updated, it is copied to the computer clipboard. This allows to copy some text from the device, then just press Ctrl+v on the computer.

But if your computer clipboard is updated, it is not automatically sent to the device (this would cause a security issue, because copying a password on the computer would send it to the device, and all apps could listen). Instead, it is only sent on Ctrl(+shift)+v.

Could you screen-capture the behavior you describe, please?

How do you copy-paste between your applications? Ctrl+c/Ctrl+v? Does it also happen when you right-click, then click on "paste" (in an app having such a menu)?

I would suggest to only read clipboard on Ctrl[+Shift]+V when scrcpy is in focus

scrcpy should not receive these keys at all if it doesn't have focus.

Optional: Extend the clipboard length more than 4093

Already done on dev branch: 488d22d

@quangkieu
Copy link
Author

2020-07-09_20-05-22
Here is my gif of copy/paste outside of scrcpy and the trucated

@rom1v
Copy link
Collaborator

rom1v commented Jul 10, 2020

Please retest with these changes (adding more logs):

diff
diff --git a/app/src/input_manager.c b/app/src/input_manager.c
index e8ba9f79..accffb8b 100644
--- a/app/src/input_manager.c
+++ b/app/src/input_manager.c
@@ -106,6 +106,8 @@ request_device_clipboard(struct controller *controller) {
     struct control_msg msg;
     msg.type = CONTROL_MSG_TYPE_GET_CLIPBOARD;
 
+    LOGI("request_device_clipboard");
+
     if (!controller_push_msg(controller, &msg)) {
         LOGW("Could not request device clipboard");
     }
@@ -124,6 +126,9 @@ set_device_clipboard(struct controller *controller, bool paste) {
         return;
     }
 
+    LOGI("set_device_clipboard (%s): %d", paste ? "paste" : "-",
+                                          (int) strlen(text));
+
     struct control_msg msg;
     msg.type = CONTROL_MSG_TYPE_SET_CLIPBOARD;
     msg.set_clipboard.text = text;
diff --git a/app/src/receiver.c b/app/src/receiver.c
index 0474ff55..c30678c0 100644
--- a/app/src/receiver.c
+++ b/app/src/receiver.c
@@ -26,7 +26,8 @@ static void
 process_msg(struct device_msg *msg) {
     switch (msg->type) {
         case DEVICE_MSG_TYPE_CLIPBOARD:
-            LOGI("Device clipboard copied");
+            LOGI("Device clipboard copied %d",
+                 (int) strlen(msg->clipboard.text));
             SDL_SetClipboardText(msg->clipboard.text);
             break;
     }
diff --git a/server/src/main/java/com/genymobile/scrcpy/Controller.java b/server/src/main/java/com/genymobile/scrcpy/Controller.java
index 960c6a6e..e4ebc32a 100644
--- a/server/src/main/java/com/genymobile/scrcpy/Controller.java
+++ b/server/src/main/java/com/genymobile/scrcpy/Controller.java
@@ -105,12 +105,14 @@ public class Controller {
                 break;
             case ControlMessage.TYPE_GET_CLIPBOARD:
                 String clipboardText = device.getClipboardText();
+                Ln.i("GET_CLIPBOARD: " + (clipboardText != null ? clipboardText.length() : "null"));
                 if (clipboardText != null) {
                     sender.pushClipboardText(clipboardText);
                 }
                 break;
             case ControlMessage.TYPE_SET_CLIPBOARD:
                 boolean paste = (msg.getFlags() & ControlMessage.FLAGS_PASTE) != 0;
+                Ln.i("SET_CLIPBOARD (" + paste + "): " + msg.getText().length());
                 setClipboard(msg.getText(), paste);
                 break;
             case ControlMessage.TYPE_SET_SCREEN_POWER_MODE:
@@ -195,6 +197,7 @@ public class Controller {
             }
         }
 
+        Ln.i("point = " + point);
         MotionEvent event = MotionEvent
                 .obtain(lastTouchDown, now, action, pointerCount, pointerProperties, pointerCoords, 0, buttons, 1f, 1f, DEVICE_ID_VIRTUAL, 0,
                         InputDevice.SOURCE_TOUCHSCREEN, 0);
diff --git a/server/src/main/java/com/genymobile/scrcpy/Server.java b/server/src/main/java/com/genymobile/scrcpy/Server.java
index 44b3afd4..a14f671b 100644
--- a/server/src/main/java/com/genymobile/scrcpy/Server.java
+++ b/server/src/main/java/com/genymobile/scrcpy/Server.java
@@ -66,6 +66,7 @@ public final class Server {
                 device.setClipboardListener(new Device.ClipboardListener() {
                     @Override
                     public void onClipboardTextChanged(String text) {
+                        Ln.i("onClipboardTextChanged(" + text.length() + ")");
                         controller.getSender().pushClipboardText(text);
                     }
                 });

(I also added a log for #1581)

  • scrcpy.exe
    SHA256: be51f8a057cf5ecf6ad7bb8699d058acb08be0208b7adc24cf46838541f67918
  • scrcpy-server
    SHA256: c731ec51d02f7ecb0539ea41566465613c356801c42f65ae80123326353a05b4

(replace these files in your v1.14 release)

Please post the console output (as text) + a video, it should help :)

Thank you

@quangkieu
Copy link
Author

quangkieu commented Jul 10, 2020

Below is the gif and the Console Output

2020-07-10_17-00-52-output

Console Dump
PS C:\Users\ktaq> scrcpy -Sw 2>&1 | Out-Host | clip
scrcpy : INFO: scrcpy 1.14 <https://github.com/Genymobile/scrcpy>
At line:1 char:1
+ scrcpy -Sw 2>&1 | Out-Host | clip
+ ~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (INFO: scrcpy 1....ymobile/scrcpy>:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

C:\ProgramData\chocolatey\lib\scrcpy\tools\scrcpy-server: 1 file pushed, 0 skipped. 58.2 MB/s (33218 bytes in 0.001s)
[server] INFO: Device: samsung SM-N970U1 (Android 10)
INFO: Created renderer: direct3d
INFO: Renderer: direct3d
INFO: Initial texture: 1080x2280
ERROR: SDL failed to get a vertex buffer for this Direct3D 9 rendering batch!
ERROR: Dropping back to a slower method.
ERROR: This might be a brief hiccup, but if performance is bad, this is probably why.
ERROR: This error will not be logged again for this renderer.
[server] INFO: Device screen turned off
[server] INFO: point = Point{x=1181, y=318}
[server] INFO: point = Point{x=1174, y=318}
[server] INFO: point = Point{x=1166, y=318}
[server] INFO: point = Point{x=1159, y=318}
[server] INFO: point = Point{x=1159, y=326}
[server] INFO: point = Point{x=1152, y=326}
[server] INFO: point = Point{x=1145, y=326}
[server] INFO: point = Point{x=1145, y=333}
[server] INFO: point = Point{x=1137, y=333}
[server] INFO: point = Point{x=1130, y=340}
[server] INFO: point = Point{x=1123, y=340}
[server] INFO: point = Point{x=1116, y=347}
[server] INFO: point = Point{x=1108, y=355}
[server] INFO: point = Point{x=1101, y=355}
[server] INFO: point = Point{x=1094, y=362}
[server] INFO: point = Point{x=1087, y=369}
[server] INFO: point = Point{x=1080, y=376}
[server] INFO: point = Point{x=1065, y=384}
[server] INFO: point = Point{x=1058, y=391}
[server] INFO: point = Point{x=1051, y=398}
[server] INFO: point = Point{x=1036, y=405}
[server] INFO: point = Point{x=1029, y=413}
[server] INFO: point = Point{x=1014, y=420}
[server] INFO: point = Point{x=1007, y=427}
[server] INFO: point = Point{x=1000, y=434}
[server] INFO: point = Point{x=993, y=441}
[server] INFO: point = Point{x=985, y=441}
[server] INFO: point = Point{x=978, y=449}
[server] INFO: point = Point{x=978, y=456}
[server] INFO: point = Point{x=971, y=463}
[server] INFO: point = Point{x=964, y=470}
[server] INFO: point = Point{x=956, y=470}
[server] INFO: point = Point{x=949, y=478}
[server] INFO: point = Point{x=949, y=485}
[server] INFO: point = Point{x=942, y=485}
[server] INFO: point = Point{x=935, y=492}
[server] INFO: point = Point{x=927, y=499}
[server] INFO: point = Point{x=927, y=507}
[server] INFO: point = Point{x=920, y=514}
[server] INFO: point = Point{x=913, y=521}
[server] INFO: point = Point{x=906, y=528}
[server] INFO: point = Point{x=898, y=536}
[server] INFO: point = Point{x=891, y=543}
[server] INFO: point = Point{x=884, y=550}
[server] INFO: point = Point{x=877, y=557}
[server] INFO: point = Point{x=869, y=565}
[server] INFO: point = Point{x=869, y=572}
[server] INFO: point = Point{x=862, y=579}
[server] INFO: point = Point{x=855, y=586}
[server] INFO: point = Point{x=848, y=601}
[server] INFO: point = Point{x=840, y=608}
[server] INFO: point = Point{x=833, y=615}
[server] INFO: point = Point{x=819, y=623}
[server] INFO: point = Point{x=811, y=630}
[server] INFO: point = Point{x=804, y=637}
[server] INFO: point = Point{x=797, y=644}
[server] INFO: point = Point{x=797, y=652}
[server] INFO: point = Point{x=790, y=659}
[server] INFO: point = Point{x=782, y=666}
[server] INFO: point = Point{x=775, y=673}
[server] INFO: point = Point{x=768, y=681}
[server] INFO: point = Point{x=761, y=688}
[server] INFO: point = Point{x=761, y=695}
[server] INFO: point = Point{x=753, y=702}
[server] INFO: point = Point{x=746, y=710}
[server] INFO: point = Point{x=739, y=717}
[server] INFO: point = Point{x=732, y=724}
[server] INFO: point = Point{x=732, y=731}
[server] INFO: point = Point{x=724, y=739}
[server] INFO: point = Point{x=724, y=746}
[server] INFO: point = Point{x=724, y=746}
[server] INFO: point = Point{x=1210, y=326}
[server] INFO: point = Point{x=1203, y=326}
[server] INFO: point = Point{x=1203, y=333}
[server] INFO: point = Point{x=1195, y=333}
[server] INFO: point = Point{x=1188, y=333}
[server] INFO: point = Point{x=1181, y=340}
[server] INFO: point = Point{x=1174, y=347}
[server] INFO: point = Point{x=1159, y=347}
[server] INFO: point = Point{x=1145, y=355}
[server] INFO: point = Point{x=1130, y=362}
[server] INFO: point = Point{x=1116, y=376}
[server] INFO: point = Point{x=1094, y=384}
[server] INFO: point = Point{x=1080, y=391}
[server] INFO: point = Point{x=1065, y=398}
[server] INFO: point = Point{x=1051, y=413}
[server] INFO: point = Point{x=1036, y=420}
[server] INFO: point = Point{x=1022, y=434}
[server] INFO: point = Point{x=1007, y=441}
[server] INFO: point = Point{x=993, y=456}
[server] INFO: point = Point{x=985, y=463}
[server] INFO: point = Point{x=971, y=478}
[server] INFO: point = Point{x=956, y=499}
[server] INFO: point = Point{x=935, y=514}
[server] INFO: point = Point{x=920, y=528}
[server] INFO: point = Point{x=906, y=550}
[server] INFO: point = Point{x=884, y=572}
[server] INFO: point = Point{x=862, y=586}
[server] INFO: point = Point{x=848, y=608}
[server] INFO: point = Point{x=826, y=623}
[server] INFO: point = Point{x=804, y=637}
[server] INFO: point = Point{x=790, y=659}
[server] INFO: point = Point{x=775, y=673}
[server] INFO: point = Point{x=761, y=688}
[server] INFO: point = Point{x=746, y=702}
[server] INFO: point = Point{x=732, y=710}
[server] INFO: point = Point{x=724, y=724}
[server] INFO: point = Point{x=717, y=731}
[server] INFO: point = Point{x=710, y=739}
[server] INFO: point = Point{x=703, y=746}
[server] INFO: point = Point{x=695, y=746}
[server] INFO: point = Point{x=695, y=753}
[server] INFO: point = Point{x=695, y=760}
[server] INFO: point = Point{x=688, y=760}
[server] INFO: point = Point{x=688, y=768}
[server] INFO: point = Point{x=688, y=775}
[server] INFO: point = Point{x=681, y=775}
[server] INFO: point = Point{x=681, y=782}
[server] INFO: point = Point{x=681, y=789}
[server] INFO: point = Point{x=681, y=797}
[server] INFO: point = Point{x=674, y=804}
[server] INFO: point = Point{x=674, y=811}
[server] INFO: point = Point{x=674, y=818}
[server] INFO: point = Point{x=666, y=818}
[server] INFO: point = Point{x=666, y=826}
[server] INFO: point = Point{x=666, y=833}
[server] INFO: point = Point{x=666, y=840}
[server] INFO: point = Point{x=659, y=840}
[server] INFO: point = Point{x=659, y=847}
[server] INFO: point = Point{x=659, y=855}
[server] INFO: point = Point{x=659, y=855}
[server] INFO: point = Point{x=-152, y=405}
[server] INFO: point = Point{x=-144, y=405}
[server] INFO: point = Point{x=-137, y=405}
[server] INFO: point = Point{x=-130, y=405}
[server] INFO: point = Point{x=-123, y=405}
[server] INFO: point = Point{x=-123, y=413}
[server] INFO: point = Point{x=-115, y=413}
[server] INFO: point = Point{x=-108, y=413}
[server] INFO: point = Point{x=-108, y=420}
[server] INFO: point = Point{x=-101, y=420}
[server] INFO: point = Point{x=-94, y=427}
[server] INFO: point = Point{x=-86, y=427}
[server] INFO: point = Point{x=-86, y=434}
[server] INFO: point = Point{x=-79, y=441}
[server] INFO: point = Point{x=-72, y=449}
[server] INFO: point = Point{x=-72, y=456}
[server] INFO: point = Point{x=-65, y=456}
[server] INFO: point = Point{x=-57, y=470}
[server] INFO: point = Point{x=-50, y=478}
[server] INFO: point = Point{x=-43, y=485}
[server] INFO: point = Point{x=-36, y=492}
[server] INFO: point = Point{x=-28, y=499}
[server] INFO: point = Point{x=-21, y=514}
[server] INFO: point = Point{x=-14, y=521}
[server] INFO: point = Point{x=-7, y=528}
[server] INFO: point = Point{x=0, y=536}
[server] INFO: point = Point{x=14, y=543}
[server] INFO: point = Point{x=21, y=550}
[server] INFO: point = Point{x=28, y=557}
[server] INFO: point = Point{x=36, y=565}
[server] INFO: point = Point{x=43, y=572}
[server] INFO: point = Point{x=43, y=579}
[server] INFO: point = Point{x=50, y=579}
[server] INFO: point = Point{x=57, y=586}
[server] INFO: point = Point{x=65, y=594}
[server] INFO: point = Point{x=72, y=594}
[server] INFO: point = Point{x=72, y=601}
[server] INFO: point = Point{x=79, y=601}
[server] INFO: point = Point{x=79, y=608}
[server] INFO: point = Point{x=86, y=608}
[server] INFO: point = Point{x=86, y=608}
[server] INFO: point = Point{x=-115, y=384}
[server] INFO: point = Point{x=-108, y=384}
[server] INFO: point = Point{x=-101, y=384}
[server] INFO: point = Point{x=-94, y=384}
[server] INFO: point = Point{x=-94, y=391}
[server] INFO: point = Point{x=-86, y=391}
[server] INFO: point = Point{x=-79, y=398}
[server] INFO: point = Point{x=-72, y=405}
[server] INFO: point = Point{x=-65, y=413}
[server] INFO: point = Point{x=-57, y=420}
[server] INFO: point = Point{x=-43, y=427}
[server] INFO: point = Point{x=-36, y=434}
[server] INFO: point = Point{x=-21, y=449}
[server] INFO: point = Point{x=-7, y=456}
[server] INFO: point = Point{x=0, y=470}
[server] INFO: point = Point{x=14, y=478}
[server] INFO: point = Point{x=28, y=485}
[server] INFO: point = Point{x=43, y=499}
[server] INFO: point = Point{x=50, y=507}
[server] INFO: point = Point{x=65, y=514}
[server] INFO: point = Point{x=72, y=528}
[server] INFO: point = Point{x=86, y=536}
[server] INFO: point = Point{x=101, y=550}
[server] INFO: point = Point{x=108, y=557}
[server] INFO: point = Point{x=123, y=572}
[server] INFO: point = Point{x=130, y=579}
[server] INFO: point = Point{x=137, y=586}
[server] INFO: point = Point{x=144, y=594}
[server] INFO: point = Point{x=152, y=601}
[server] INFO: point = Point{x=159, y=608}
[server] INFO: point = Point{x=166, y=615}
[server] INFO: point = Point{x=173, y=615}
[server] INFO: point = Point{x=173, y=623}
[server] INFO: point = Point{x=173, y=630}
[server] INFO: point = Point{x=181, y=630}
[server] INFO: point = Point{x=181, y=637}
[server] INFO: point = Point{x=188, y=637}
[server] INFO: point = Point{x=188, y=644}
[server] INFO: point = Point{x=188, y=652}
[server] INFO: point = Point{x=195, y=652}
[server] INFO: point = Point{x=195, y=659}
[server] INFO: point = Point{x=195, y=659}
[server] INFO: point = Point{x=1043, y=318}
[server] INFO: point = Point{x=1043, y=326}
[server] INFO: point = Point{x=1036, y=326}
[server] INFO: point = Point{x=1036, y=333}
[server] INFO: point = Point{x=1036, y=340}
[server] INFO: point = Point{x=1029, y=340}
[server] INFO: point = Point{x=1029, y=347}
[server] INFO: point = Point{x=1022, y=347}
[server] INFO: point = Point{x=1022, y=355}
[server] INFO: point = Point{x=1014, y=355}
[server] INFO: point = Point{x=1014, y=362}
[server] INFO: point = Point{x=1007, y=369}
[server] INFO: point = Point{x=1007, y=376}
[server] INFO: point = Point{x=1000, y=376}
[server] INFO: point = Point{x=1000, y=384}
[server] INFO: point = Point{x=993, y=384}
[server] INFO: point = Point{x=993, y=391}
[server] INFO: point = Point{x=993, y=398}
[server] INFO: point = Point{x=985, y=398}
[server] INFO: point = Point{x=985, y=405}
[server] INFO: point = Point{x=978, y=405}
[server] INFO: point = Point{x=978, y=413}
[server] INFO: point = Point{x=978, y=420}
[server] INFO: point = Point{x=978, y=427}
[server] INFO: point = Point{x=971, y=427}
[server] INFO: point = Point{x=971, y=434}
[server] INFO: point = Point{x=971, y=441}
[server] INFO: point = Point{x=971, y=449}
[server] INFO: point = Point{x=964, y=449}
[server] INFO: point = Point{x=964, y=456}
[server] INFO: point = Point{x=964, y=463}
[server] INFO: point = Point{x=956, y=463}
[server] INFO: point = Point{x=956, y=470}
[server] INFO: point = Point{x=949, y=478}
[server] INFO: point = Point{x=949, y=485}
[server] INFO: point = Point{x=942, y=485}
[server] INFO: point = Point{x=942, y=492}
[server] INFO: point = Point{x=935, y=499}
[server] INFO: point = Point{x=935, y=507}
[server] INFO: point = Point{x=927, y=507}
[server] INFO: point = Point{x=927, y=514}
[server] INFO: point = Point{x=927, y=521}
[server] INFO: point = Point{x=920, y=521}
[server] INFO: point = Point{x=920, y=528}
[server] INFO: point = Point{x=920, y=536}
[server] INFO: point = Point{x=920, y=543}
[server] INFO: point = Point{x=913, y=543}
[server] INFO: point = Point{x=913, y=550}
[server] INFO: point = Point{x=906, y=550}
[server] INFO: point = Point{x=906, y=557}
[server] INFO: point = Point{x=906, y=565}
[server] INFO: point = Point{x=898, y=565}
[server] INFO: point = Point{x=898, y=572}
[server] INFO: point = Point{x=898, y=579}
[server] INFO: point = Point{x=891, y=579}
[server] INFO: point = Point{x=891, y=586}
[server] INFO: point = Point{x=884, y=586}
[server] INFO: point = Point{x=884, y=594}
[server] INFO: point = Point{x=884, y=601}
[server] INFO: point = Point{x=877, y=601}
[server] INFO: point = Point{x=877, y=608}
[server] INFO: point = Point{x=877, y=615}
[server] INFO: point = Point{x=869, y=615}
[server] INFO: point = Point{x=869, y=623}
[server] INFO: point = Point{x=869, y=630}
[server] INFO: point = Point{x=869, y=637}
[server] INFO: point = Point{x=862, y=637}
[server] INFO: point = Point{x=862, y=644}
[server] INFO: point = Point{x=862, y=652}
[server] INFO: point = Point{x=855, y=652}
[server] INFO: point = Point{x=855, y=659}
[server] INFO: point = Point{x=855, y=666}
[server] INFO: point = Point{x=855, y=673}
[server] INFO: point = Point{x=848, y=673}
[server] INFO: point = Point{x=848, y=681}
[server] INFO: point = Point{x=848, y=688}
[server] INFO: point = Point{x=840, y=688}
[server] INFO: point = Point{x=840, y=695}
[server] INFO: point = Point{x=840, y=702}
[server] INFO: point = Point{x=840, y=710}
[server] INFO: point = Point{x=833, y=717}
[server] INFO: point = Point{x=833, y=724}
[server] INFO: point = Point{x=833, y=731}
[server] INFO: point = Point{x=826, y=739}
[server] INFO: point = Point{x=826, y=746}
[server] INFO: point = Point{x=826, y=760}
[server] INFO: point = Point{x=826, y=768}
[server] INFO: point = Point{x=819, y=775}
[server] INFO: point = Point{x=819, y=782}
[server] INFO: point = Point{x=819, y=797}
[server] INFO: point = Point{x=811, y=804}
[server] INFO: point = Point{x=811, y=811}
[server] INFO: point = Point{x=811, y=818}
[server] INFO: point = Point{x=804, y=833}
[server] INFO: point = Point{x=804, y=840}
[server] INFO: point = Point{x=804, y=847}
[server] INFO: point = Point{x=804, y=855}
[server] INFO: point = Point{x=797, y=862}
[server] INFO: point = Point{x=797, y=869}
[server] INFO: point = Point{x=797, y=876}
[server] INFO: point = Point{x=797, y=883}
[server] INFO: point = Point{x=797, y=891}
[server] INFO: point = Point{x=790, y=898}
[server] INFO: point = Point{x=790, y=905}
[server] INFO: point = Point{x=790, y=912}
[server] INFO: point = Point{x=790, y=920}
[server] INFO: point = Point{x=782, y=934}
[server] INFO: point = Point{x=782, y=941}
[server] INFO: point = Point{x=782, y=949}
[server] INFO: point = Point{x=782, y=956}
[server] INFO: point = Point{x=775, y=956}
[server] INFO: point = Point{x=775, y=963}
[server] INFO: point = Point{x=775, y=970}
[server] INFO: point = Point{x=775, y=978}
[server] INFO: point = Point{x=775, y=985}
[server] INFO: point = Point{x=775, y=992}
[server] INFO: point = Point{x=768, y=992}
[server] INFO: point = Point{x=768, y=999}
[server] INFO: point = Point{x=768, y=1007}
[server] INFO: point = Point{x=768, y=1014}
[server] INFO: point = Point{x=761, y=1014}
[server] INFO: point = Point{x=761, y=1021}
[server] INFO: point = Point{x=753, y=1028}
[server] INFO: point = Point{x=753, y=1036}
[server] INFO: point = Point{x=746, y=1036}
[server] INFO: point = Point{x=746, y=1043}
[server] INFO: point = Point{x=746, y=1043}
[server] INFO: point = Point{x=1036, y=492}
[server] INFO: point = Point{x=1036, y=499}
[server] INFO: point = Point{x=1036, y=507}
[server] INFO: point = Point{x=1036, y=514}
[server] INFO: point = Point{x=1029, y=514}
[server] INFO: point = Point{x=1029, y=521}
[server] INFO: point = Point{x=1022, y=521}
[server] INFO: point = Point{x=1022, y=528}
[server] INFO: point = Point{x=1022, y=536}
[server] INFO: point = Point{x=1014, y=536}
[server] INFO: point = Point{x=1014, y=543}
[server] INFO: point = Point{x=1014, y=550}
[server] INFO: point = Point{x=1014, y=557}
[server] INFO: point = Point{x=1007, y=557}
[server] INFO: point = Point{x=1007, y=565}
[server] INFO: point = Point{x=1007, y=572}
[server] INFO: point = Point{x=1000, y=579}
[server] INFO: point = Point{x=1000, y=586}
[server] INFO: point = Point{x=1000, y=594}
[server] INFO: point = Point{x=993, y=594}
[server] INFO: point = Point{x=993, y=601}
[server] INFO: point = Point{x=985, y=608}
[server] INFO: point = Point{x=985, y=615}
[server] INFO: point = Point{x=978, y=623}
[server] INFO: point = Point{x=978, y=630}
[server] INFO: point = Point{x=971, y=637}
[server] INFO: point = Point{x=971, y=644}
[server] INFO: point = Point{x=964, y=652}
[server] INFO: point = Point{x=964, y=659}
[server] INFO: point = Point{x=956, y=666}
[server] INFO: point = Point{x=956, y=673}
[server] INFO: point = Point{x=949, y=681}
[server] INFO: point = Point{x=949, y=688}
[server] INFO: point = Point{x=942, y=688}
[server] INFO: point = Point{x=942, y=695}
[server] INFO: point = Point{x=935, y=695}
[server] INFO: point = Point{x=935, y=702}
[server] INFO: point = Point{x=935, y=710}
[server] INFO: point = Point{x=927, y=710}
[server] INFO: point = Point{x=927, y=717}
[server] INFO: point = Point{x=927, y=724}
[server] INFO: point = Point{x=920, y=724}
[server] INFO: point = Point{x=920, y=731}
[server] INFO: point = Point{x=920, y=739}
[server] INFO: point = Point{x=913, y=739}
[server] INFO: point = Point{x=913, y=746}
[server] INFO: point = Point{x=906, y=746}
[server] INFO: point = Point{x=906, y=753}
[server] INFO: point = Point{x=898, y=760}
[server] INFO: point = Point{x=898, y=768}
[server] INFO: point = Point{x=891, y=768}
[server] INFO: point = Point{x=891, y=775}
[server] INFO: point = Point{x=884, y=775}
[server] INFO: point = Point{x=884, y=782}
[server] INFO: point = Point{x=884, y=789}
[server] INFO: point = Point{x=877, y=789}
[server] INFO: point = Point{x=877, y=797}
[server] INFO: point = Point{x=869, y=797}
[server] INFO: point = Point{x=869, y=804}
[server] INFO: point = Point{x=869, y=811}
[server] INFO: point = Point{x=862, y=811}
[server] INFO: point = Point{x=862, y=818}
[server] INFO: point = Point{x=855, y=826}
[server] INFO: point = Point{x=855, y=833}
[server] INFO: point = Point{x=848, y=833}
[server] INFO: point = Point{x=848, y=840}
[server] INFO: point = Point{x=848, y=847}
[server] INFO: point = Point{x=840, y=847}
[server] INFO: point = Point{x=840, y=855}
[server] INFO: point = Point{x=840, y=862}
[server] INFO: point = Point{x=833, y=862}
[server] INFO: point = Point{x=833, y=869}
[server] INFO: point = Point{x=826, y=869}
[server] INFO: point = Point{x=826, y=876}
[server] INFO: point = Point{x=826, y=883}
[server] INFO: point = Point{x=819, y=883}
[server] INFO: point = Point{x=819, y=891}
[server] INFO: point = Point{x=811, y=898}
[server] INFO: point = Point{x=811, y=905}
[server] INFO: point = Point{x=804, y=912}
[server] INFO: point = Point{x=804, y=920}
[server] INFO: point = Point{x=797, y=920}
[server] INFO: point = Point{x=797, y=927}
[server] INFO: point = Point{x=797, y=934}
[server] INFO: point = Point{x=797, y=941}
[server] INFO: point = Point{x=790, y=941}
[server] INFO: point = Point{x=790, y=949}
[server] INFO: point = Point{x=790, y=956}
[server] INFO: point = Point{x=790, y=963}
[server] INFO: point = Point{x=782, y=963}
[server] INFO: point = Point{x=782, y=970}
[server] INFO: point = Point{x=782, y=978}
[server] INFO: point = Point{x=775, y=978}
[server] INFO: point = Point{x=775, y=985}
[server] INFO: point = Point{x=775, y=992}
[server] INFO: point = Point{x=768, y=992}
[server] INFO: point = Point{x=768, y=999}
[server] INFO: point = Point{x=768, y=1007}
[server] INFO: point = Point{x=761, y=1007}
[server] INFO: point = Point{x=761, y=1014}
[server] INFO: point = Point{x=761, y=1021}
[server] INFO: point = Point{x=761, y=1028}
[server] INFO: point = Point{x=753, y=1028}
[server] INFO: point = Point{x=753, y=1036}
[server] INFO: point = Point{x=753, y=1043}
[server] INFO: point = Point{x=753, y=1050}
[server] INFO: point = Point{x=746, y=1050}
[server] INFO: point = Point{x=746, y=1057}
[server] INFO: point = Point{x=746, y=1065}
[server] INFO: point = Point{x=746, y=1072}
[server] INFO: point = Point{x=739, y=1072}
[server] INFO: point = Point{x=739, y=1079}
[server] INFO: point = Point{x=739, y=1086}
[server] INFO: point = Point{x=739, y=1094}
[server] INFO: point = Point{x=739, y=1101}
[server] INFO: point = Point{x=732, y=1101}
[server] INFO: point = Point{x=732, y=1108}
[server] INFO: point = Point{x=732, y=1115}
[server] INFO: point = Point{x=732, y=1123}
[server] INFO: point = Point{x=732, y=1130}
[server] INFO: point = Point{x=732, y=1137}
[server] INFO: point = Point{x=724, y=1144}
[server] INFO: point = Point{x=724, y=1152}
[server] INFO: point = Point{x=724, y=1159}
[server] INFO: point = Point{x=724, y=1166}
[server] INFO: point = Point{x=724, y=1173}
[server] INFO: point = Point{x=717, y=1181}
[server] INFO: point = Point{x=717, y=1188}
[server] INFO: point = Point{x=717, y=1195}
[server] INFO: point = Point{x=717, y=1202}
[server] INFO: point = Point{x=717, y=1210}
[server] INFO: point = Point{x=717, y=1217}
[server] INFO: point = Point{x=710, y=1217}
[server] INFO: point = Point{x=710, y=1224}
[server] INFO: point = Point{x=710, y=1239}
[server] INFO: point = Point{x=710, y=1246}
[server] INFO: point = Point{x=710, y=1253}
[server] INFO: point = Point{x=703, y=1260}
[server] INFO: point = Point{x=703, y=1268}
[server] INFO: point = Point{x=703, y=1275}
[server] INFO: point = Point{x=703, y=1282}
[server] INFO: point = Point{x=703, y=1289}
[server] INFO: point = Point{x=695, y=1296}
[server] INFO: point = Point{x=695, y=1304}
[server] INFO: point = Point{x=695, y=1311}
[server] INFO: point = Point{x=695, y=1318}
[server] INFO: point = Point{x=688, y=1318}
[server] INFO: point = Point{x=688, y=1325}
[server] INFO: point = Point{x=688, y=1333}
[server] INFO: point = Point{x=688, y=1340}
[server] INFO: point = Point{x=681, y=1340}
[server] INFO: point = Point{x=681, y=1347}
[server] INFO: point = Point{x=681, y=1354}
[server] INFO: point = Point{x=674, y=1354}
[server] INFO: point = Point{x=674, y=1362}
[server] INFO: point = Point{x=674, y=1369}
[server] INFO: point = Point{x=666, y=1369}
[server] INFO: point = Point{x=666, y=1376}
[server] INFO: point = Point{x=666, y=1376}

@rom1v
Copy link
Collaborator

rom1v commented Jul 10, 2020

OK, thank you for the results.

So the events outside the screen are correctly forwarded. Your device software just don't consider them for gestures.

So I'm closing, there is no problem on scrcpy side.

@rom1v rom1v closed this as completed Jul 10, 2020
@rom1v rom1v reopened this Jul 10, 2020
@quangkieu
Copy link
Author

quangkieu commented Jul 10, 2020

Sorry, wrong gif and Console

2020-07-10_17-16-19

Details
PS C:\Users\ktaq> scrcpy -Sw 2>&1
scrcpy : INFO: scrcpy 1.14 <https://github.com/Genymobile/scrcpy>
At line:1 char:1
+ scrcpy -Sw 2>&1
+ ~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (INFO: scrcpy 1....ymobile/scrcpy>:String) [], RemoteExc
   eption
    + FullyQualifiedErrorId : NativeCommandError

C:\ProgramData\chocolatey\lib\scrcpy\tools\scrcpy...hed, 0 skipped. 34.1 MB/s (33218 bytes in 0.001s)
[server] INFO: Device: samsung SM-N970U1 (Android 10)
INFO: Created renderer: direct3d
INFO: Renderer: direct3d
INFO: Initial texture: 1080x2280
[server] INFO: Device screen turned offERROR: SDL failed to get a vertex buffer for this Direct3D 9 rendering batch!
ERROR: Dropping back to a slower method.
ERROR: This might be a brief hiccup, but if performance is bad, this is probably why.
ERROR: This error will not be logged again for this renderer.

[server] INFO: onClipboardTextChanged(6284)INFO: Device clipboard copied 4092

[server] INFO: onClipboardTextChanged(3669)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)INFO: Device clipboard copied 4093

[server] INFO: onClipboardTextChanged(3543)INFO: Device clipboard copied 4093

[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)INFO: Device clipboard copied 4093

[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(6284)
INFO: Device clipboard copied 4092
[server] INFO: onClipboardTextChanged(6284)
INFO: Device clipboard copied 4092
[server] INFO: onClipboardTextChanged(3669)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)INFO: Device clipboard copied 4093

[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093
[server] INFO: onClipboardTextChanged(3543)
INFO: Device clipboard copied 4093

@rom1v
Copy link
Collaborator

rom1v commented Jul 10, 2020

OK, so it seems that when you copy, the content is synchronized to your device clipboard (even without scrcpy). As a consequence, when scrcpy is open, the device clipboard change is synchronized back to the computer (but truncated).

If you close scrcpy, copy some text in your VScode, can you paste it directly on your device in some text area (long-click, paste)?

@quangkieu
Copy link
Author

So I copy the text in vscode before open scrcpy. Then run scrcpy. I am able to paste my long content into some android text editor

@rom1v
Copy link
Collaborator

rom1v commented Jul 10, 2020

If you don't use scrcpy at all, copy some text (not necessarily long, just few characters) in VScode while your device is plugged, is the content automatically copied to the device clipboard? If you paste on the device, does it paste the content you just copied in VScode?

@quangkieu
Copy link
Author

quangkieu commented Jul 10, 2020

Now that you mention it, yeah, it does sync my clipboard to the phone. I setup Microsot Your Phone but it is closed during the test and the clipboard still sync

@quangkieu
Copy link
Author

I think because I am beta build, they have that clipboard auto sync. I disable feature and it is good now.

@quangkieu
Copy link
Author

image

@rom1v
Copy link
Collaborator

rom1v commented Jul 10, 2020

👍

Btw, that's a worrying feature: anytime you copy something on your computer (even without pasting to the device), the content is sent to the device (and to all the apps who can listen to the clipboard).

I'm already worried that scrcpy will probably do that when you explicitly paste to the device: #1465 (comment)

rom1v added a commit that referenced this issue Jul 16, 2020
Do not explicitly set the clipboard text if it already contains the
expected content.

Even if copy-paste loops are avoided by the previous commit, this avoids
to trigger a clipboard change on the computer-side.

Refs #1580 <#1580>
rom1v added a commit that referenced this issue Jul 16, 2020
Do not explicitly set the clipboard text if it already contains the
expected content.

Even if copy-paste loops are avoided by the previous commit, this avoids
to trigger a clipboard change on the computer-side.

Refs #1580 <#1580>
rom1v added a commit that referenced this issue Jul 17, 2020
Do not explicitly set the clipboard text if it already contains the
expected content.

Even if copy-paste loops are avoided by the previous commit, this avoids
to trigger a clipboard change on the computer-side.

Refs #1580 <#1580>
rom1v added a commit that referenced this issue Aug 1, 2020
Do not explicitly set the clipboard text if it already contains the
expected content.

Even if copy-paste loops are avoided by the previous commit, this avoids
to trigger a clipboard change on the computer-side.

Refs #1580 <#1580>
rom1v added a commit that referenced this issue Aug 1, 2020
Do not explicitly set the clipboard text if it already contains the
expected content.

Even if copy-paste loops are avoided by the previous commit, this avoids
to trigger a clipboard change on the computer-side.

Refs #1580 <#1580>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants