termux / termux-x11

Termux X11 add-on application.
https://termux.dev
GNU General Public License v3.0
1.96k stars 301 forks source link

Enable Android cursor #221

Closed IntinteDAO closed 1 year ago

IntinteDAO commented 1 year ago

In brief, the cursor in Termux-X11 is drawn by Termux. It may not be (e.g. in the case of slow hardware) smooth. Some solutions like XServer XSDL, AVNC etc. allow you to enable the physical Android cursor and hide the XServer cursor.

If I'm not mistaken the Android cursor will be rendered on the graphics card, so it is ultra-smooth.

By default, the Termux-X11 (Android) cursor is hidden, so it would be nice if there was an option to enable it (and possibly hide the Termux cursor).

twaik commented 1 year ago

It may not be (e.g. in the case of slow hardware) smooth

Do you mean cursor related to hardware mouse? I think it is possible, but a bit problematic because regular application has less control on pointer states...

IntinteDAO commented 1 year ago

Do you mean cursor related to hardware mouse? I think it is possible, but a bit problematic because regular application has less control on pointer states...

That would be best. I generally use the mouse on the Termux X11 and it's possible to use it, but you can see that it's not ultra-smooth movement like the native cursor.

twaik commented 1 year ago

On my devices it is smooth. It is rendered almodt same way Android renders cursor. Can you please post video showing non-smoothness and post termux-info log?

IntinteDAO commented 1 year ago

On my devices it is smooth.

Hmm, you have right. But what about delay between moving cursor on Android and on Termux X11? In TigerVNC + AVNC "remote" cursor is little slower than Android cursor

twaik commented 1 year ago

I am not sure what you are tasking about. Termux:X11 does not get coordinates from Xwayland. It simply moves cursor icon to the last known location of cursor sent to Xwayland. It does not get it from somewhere. Maybe this delay is under View's responsibility. I am not sure if I can override this behaviour.

twaik commented 1 year ago

It looks like I found the root of problem. Cursor coordinates are set from compositor's event loop and that is a reason why it has a delay. I will try to set the coordinates before sending them to Xwayland.

twaik commented 1 year ago

Check if it happens with latest build from here.

RaWolFoX commented 1 year ago

@twaik your fork is working fine on my device now. Only problem i found is when full screen option is enabled, screen reseeding not working. (only your fork is working good. Termux version is still buggy.)

twaik commented 1 year ago

Termux version is also mine. The fork is needed because most parts of the code have been changed in one way or another.

RaWolFoX commented 1 year ago

Termux version is also mine. The fork is needed because most parts of the code have been changed in one way or another.

I noticed that 😃👍🏻

IntinteDAO commented 1 year ago

Check if it happens with latest build from here.

Well, I can't feel any lagg now, so it might be fixed. Closing?

twaik commented 1 year ago

Yeah, Why not. Can you please click close?

twaik commented 1 year ago

Ok, I'll do that.