-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Samsung Browser doesn't do anything on touch inputs (left click) #2169
Comments
Could you please test older scrcpy version? (or even git bisect, if you know how to) |
didn't know about git bisect, but it was fun learning it.
I did a revert of this commit on the latest tag, and it solves the issue (for me at least) |
Oh, thank you very much for the bisect 👍 diff --git a/app/src/event_converter.c b/app/src/event_converter.c
index ab48898d..7bc56ed4 100644
--- a/app/src/event_converter.c
+++ b/app/src/event_converter.c
@@ -1,6 +1,7 @@
#include "event_converter.h"
#include "config.h"
+#include "util/log.h"
#define MAP(FROM, TO) case FROM: *to = TO; return true
#define FAIL default: return false
@@ -174,6 +175,7 @@ convert_mouse_buttons(uint32_t state) {
if (state & SDL_BUTTON_X2MASK) {
buttons |= AMOTION_EVENT_BUTTON_FORWARD;
}
+ LOGI("buttons = %x\n", buttons);
return buttons;
}
diff --git a/server/src/main/java/com/genymobile/scrcpy/Controller.java b/server/src/main/java/com/genymobile/scrcpy/Controller.java
index 84780239..c70eebaf 100644
--- a/server/src/main/java/com/genymobile/scrcpy/Controller.java
+++ b/server/src/main/java/com/genymobile/scrcpy/Controller.java
@@ -172,6 +172,7 @@ public class Controller {
}
private boolean injectTouch(int action, long pointerId, Position position, float pressure, int buttons) {
+ Ln.i("buttons = " + Integer.toHexString(buttons));
long now = SystemClock.uptimeMillis();
Point point = device.getPhysicalPoint(position);
Could you please add some logs? (on current Then, when you click, it should print these logs in the console. |
INFO: scrcpy 1.17 https://github.com/Genymobile/scrcpy ... logcat output for touch events in samsung browser for comparison, that's a logcat from chrome browser and finally with the revert of 17d53be (samsung browser) |
(0x11) so clicks are working only if you indicate that This looks like a bug in the browser. Could you also apply this change: #2125 (comment) |
ok, I did the change. It doesn't help with the issue. whit 17d53be without 17d53be |
I have the same problem. On an old phone (Redmi 6), the solution is to install version 12.1.4.3. Everything works on it. But the market version is now 13.2.2.4 and there is a problem with it. |
I'm facing the same issue with the Samsung Browser. I was trying to compare the
and for
Changing |
Hmmm, I understand that diff --git a/server/src/main/java/com/genymobile/scrcpy/Controller.java b/server/src/main/java/com/genymobile/scrcpy/Controller.java
index d8059b43..21ff6932 100644
--- a/server/src/main/java/com/genymobile/scrcpy/Controller.java
+++ b/server/src/main/java/com/genymobile/scrcpy/Controller.java
@@ -208,6 +208,9 @@ public class Controller {
// Right-click and middle-click only work if the source is a mouse
boolean nonPrimaryButtonPressed = (buttons & ~MotionEvent.BUTTON_PRIMARY) != 0;
int source = nonPrimaryButtonPressed ? InputDevice.SOURCE_MOUSE : InputDevice.SOURCE_TOUCHSCREEN;
+ if (source != InputDevice.SOURCE_MOUSE) {
+ buttons = 0;
+ }
MotionEvent event = MotionEvent
.obtain(lastTouchDown, now, action, pointerCount, pointerProperties, pointerCoords, 0, buttons, 1f, 1f, DEVICE_ID_VIRTUAL, 0, source, However, more generally, I guess using But I remember doing that in the past, and it changes the actual behavior, at least on text selection. The mouse behavior seems acceptable, but I remember that there were cases were it was not (even when using a mouse on the computer), I don't remember which cases. (And it complicates the behavior when both mouse and touch events are generated from the computer, but that's secondary.) |
But that problem was maybe related to #2125 (comment). |
In fact, using |
BUTTON_PRIMARY must not be set for touch events: > This button constant is not set in response to simple touches with a > finger or stylus tip. The user must actually push a button. <https://developer.android.com/reference/android/view/MotionEvent#BUTTON_PRIMARY> Fixes #2169 <#2169>
Could you please confirm that it works correctly on branch |
Yes, that works with the Samsung Browser |
👍 Let's merge it (into |
Environment
Describe the bug
Samsung Browser (Samsung Internet 13.2.2.4) doesn't do anything on touch inputs (left click) on the website rendered area. Scroll wheel works however, the UI elements are responsive to left clicks as well. No problems on chrome browser.
It worked in the past. I can't remember if a new version of scrcpy or samsung internet introduced this bug.
logcat output while trying to do inputs with left mouse click:
03-05 10:31:57.323 3329 3354 I chromium: [INFO:web_view_impl.cc(2030)] SBRTOUCHLOG Blink HandleInputEvent event received = MouseMove
The text was updated successfully, but these errors were encountered: