termux / termux-x11

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

[Bug]: Wrong touching position #569

Closed numberokta closed 5 months ago

numberokta commented 5 months ago

Problem description

When touchMode is Simulated touchscreen and Reseed is true and soft keyboard is open, makes touching in wrong position

What steps will reproduce the bug?

touchmode='Simulated touchscreen' Reseed=true open soft keyboard touching the screen simulates touching in the wrong position

What is the expected behavior?

I think touching display size does not change when soft keyboard is opened and display scale is changed and it must be fix

twaik commented 5 months ago

I can not reproduce this. Can you record your screen with show taps and pointer location toggles active?

![image](https://github.com/termux/termux-x11/assets/9674930/f36fe884-fab8-4ecd-bad3-eec53daa7a18)
numberokta commented 5 months ago

you first must open soft keyboard and then run

PATH=/data/data/com.termux/files/usr/bin termux-am broadcast --user 0 -a com.termux.x11.CHANGE_PREFERENCE -p com.termux.x11 -e touchMode 'Simulated touchscreen'

from terminal in termux-x11 while soft keyboard is open. now close soft keyboard and touch somewhere

https://github.com/termux/termux-x11/assets/20727200/7552ab09-3dde-4757-b6c4-e11458a0ef49

numberokta commented 5 months ago

It's not long tap release, it's tap release and it just get wrong touching position because of changing display scale after closing soft keyboard. the new version is so much better and have more feature and still under developing.

numberokta commented 5 months ago

First i show that in Trackpad mode everything's ok and then execute command to change touchMode to Simulated touchscreen and then tap on screen while soft keyboard is open, then i close soft keyboard and tap on screen and as you can see touch point and cursor position is not same

ewt45 commented 5 months ago

I can reproduce this when display resolution mode=custom/exact and touchscreen input mode=simulated touchscreen. when toggling soft input, somehow LorieView.mSurfaceCallback.surfaceChanged() is not called at all. So the transformation is not updated. The only difference I can tell is that

maybe it's better to call LorieView.triggerCallback() manually when toggling soft input?

twaik commented 5 months ago

Again. The topic is "Wrong touching position" and topicstarter described it pretty clear: when he uses specific touch modes and toggles keyboard position of cursor is wrong. No lost gestures. Another user even found the reason of this: LorieView.mSurfaceCallback.surfaceChanged() is not called because surface size was not changed. Next time you post off-topic message it will be deleted immediately. Older off-topic messages will be deleted immediately too.

twaik commented 5 months ago

@numberokta @ewt45 can you please test the latest build on https://github.com/termux/termux-x11/actions/runs/8223825785 ?

numberokta commented 5 months ago

@twaik thanks

ewt45 commented 5 months ago

@numberokta @ewt45 can you please test the latest build on https://github.com/termux/termux-x11/actions/runs/8223825785 ?

yes, it works correctly now