-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
Android 14: Samsung phones - mouse actions (left click/scroll) stop working on virtual display #4598
Comments
got the same issue on oneplus 8t android 14 custom rom. your right it makes another display and click events pass to it. but on the other display nothing however my attempt is to use the PER APP screen share app called ag displays. any display it shares no input can pass. not even controllers connected to the android device itself for gaming purposes. not sure how to work around this. so far the only thing that works for me is desktop mode and dealing with the ugly bar at the top even if freeform is disabled., really not sure what is going on,. |
don't think this is an intended behaviour as some people this works just fine, I sure hope someone can come in and help us out. iv been trying to fix this for awhile myself |
For Samsung phones, the same issue even with desktop mode. |
Hi @rom1v ,
If yes, I think we can fix above issue by adding addtional call for Samsung devices with Android 14 version Please correct me if I am wrong. Thank you for your time. |
It might solve the problem in specific cases, but why is the display id for events is different from the display id for display? Is it always +1? On which devices? (because on many devices it's the same) |
Thanks @rom1v for your reply.
I actually don't know the exact reason. But I think this for something relating to Samsung Dex because I could see similiar things before Android 14 when I tried to mirror the activated Dex display (display-id=2) by scrcpy tool, a new display with display-id=3 for example was also created then. I could see the content of display-id=2 but there was no thing but black window with display-id=3 (I guess it was used for receiving events from PC Dex app). Mirroring virtual display (not Dex display) in Samsung devices before Android 14 did not create a new display-id. This just happened from Android 14. In addition, I could see Dex mode had obvious enhancement in Android 14, it now has similar experience like virtual display rather than independent system app. I think Samsung aligned/adapted Dex mode with virtual display/desktop experience.
For general cases, it should be a new added ID number in display list.
If I mirror the display with display-id=3, a new display with display-id=5 is created to receive left mouse click and scroll actions only (right mouse click actions, texts from keyboard... still works on display-id=3)
About this, I think we should have a switch/option like Please tell me your opinion? |
Hi @rom1v
I wonder if there is any way to determine action type from the input event so that I can set all left mouse click/scroll actions with a special display id (clickDisplayId) and other actions (right click, keyboard...) with (displayId). I have been doing some research on the internet but I have not found out the way.
Do you have any idea? |
Hi @rom1v
With above modification, scrcpy works as expected (all actions including click/scroll,... works on virtual display of Android 14 devices) |
@huynhtanloc2612 I will check when I work on #5175, but I have to finish my work on gamepads beforehand (#5175 (review)). |
Thanks @rom1v
I wonder if there is any other way to create Windows release? |
Hi @rom1v , Run command: In order to create an virtual displays, you can refer to this video https://youtu.be/ysv5OL3IL1w?si=UI23s580cuACOaRr |
This is a very useful PR, can we please get this merged? |
Please test #5370. |
@rom1v |
Please post on #5730 about this (so that all issues related to the PR are at the same place). Please indicate if you're mirroring the main display or a new display (and the exact command line you execute). |
Got it. I posted on #5370 . Thanks |
Yes, it fixed this issue as well. All left mouse and scroll... actions works like expected. |
@huynhtanloc2612 - were you able to get SamsungDex working? whats the command you used? |
@vaddisrinivas I have not tested DeX with this scrcpy version yet. However, AFAIK, DeX does not start with virtual display. It requires real external display to start. |
Agree with this. @vaddisrinivas you need to start DeX somehow, either through dummy HDMI (scrcpy need to connect wirelessly then), wireless DeX (to miracast device). or though DeX on PC. Only benefit of this compared to navigating from TV wirelessly or DeX on PC either wired or wireless, is that you get lesser latency. Cumbersome to setup in the end |
When mirroring a secondary display, touch and scroll events must be sent to the mirroring virtual display id (with coordinates relative to the virtual display size), rather than to the original display (with coordinates relative to the original display size). This behavior, introduced by d193967, was also applied for the main display for consistency. However, this mechanism has been found to cause some UI elements to become unclickable. To minimize inconveniences, restore the previous behavior when mirroring the main display: send all events to the original display id (0) with coordinates relative to the original display size. Fixes #5545 <#5545> Fixes #5605 <#5605> Refs #4598 <#4598> Refs #5137 <#5137> Refs #5370 <#5370>
When mirroring a secondary display, touch and scroll events must be sent to the mirroring virtual display id (with coordinates relative to the virtual display size), rather than to the original display (with coordinates relative to the original display size). This behavior, introduced by d193967, was also applied for the main display for consistency. However, it has been found to cause some UI elements to become unclickable. To minimize inconveniences, restore the previous behavior when mirroring the main display: send all events to the original display id (0) with coordinates relative to the original display size. Fixes #5545 <#5545> Fixes #5605 <#5605> Refs #4598 <#4598> Refs #5137 <#5137> Refs #5370 <#5370>
When mirroring a secondary display, touch and scroll events must be sent to the mirroring virtual display id (with coordinates relative to the virtual display size), rather than to the original display (with coordinates relative to the original display size). This behavior, introduced by d193967, was also applied for the main display for consistency. However, it causes some UI elements to become unclickable. To minimize inconveniences, restore the previous behavior when mirroring the main display: send all events to the original display id (0) with coordinates relative to the original display size. Fixes #5545 <#5545> Fixes #5605 <#5605> Fixes #5616 <#5616> Refs #4598 <#4598> Refs #5137 <#5137> Refs #5370 <#5370> PR #5614 <#5614>
Hi developers.
I am facing an issue when using scrcpy (v2.3.1) after updating my Samsung S22 ultra phone (SM-S908E) from Android 13 to 14.
An other display is automatically created when scrcpy connects with the phone.
Display id numbers before starting scrcpy
Display id numbers after starting scrcpy
A new display (id=80) is created. But there is no issue with this if I want to mirror the phone screen. Everything works perfectly.
Similarly, when I want to mirror virtual display with option (--display-id 90) as some ways mentioned in #1887 (comment) and #1887 (comment), an new display is also created with id=91
scrcpy can show the virtual display (id=90), input text from keyboard works but click action does not work.
I try to perform input events by using adb and found that virtual display can receive inputs via display with id=91 instead of id=90
-> I think the created display (id=91) is used for receiving the tap/click events. In order to prove that I start another scrcpy with --display-id=91 option. Another scrcpy can show the virtual display content and all click events work (they are injected to display with id=91).
I think this may be the intention of Samsung for Samsung DeX mode or something else.
Can you help give adivces on this case? Thanks,
The text was updated successfully, but these errors were encountered: