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

Touch screen support (Not HTML5) #3714

Open
fan87 opened this issue Dec 19, 2022 · 9 comments
Open

Touch screen support (Not HTML5) #3714

fan87 opened this issue Dec 19, 2022 · 9 comments
Labels
enhancement New feature or request

Comments

@fan87
Copy link

fan87 commented Dec 19, 2022

Is your feature request related to a problem? Please describe.
Touch screens are currently unsupported and they will be emulated as mouse input, scrolling and other touch actions won't work.
(Not HTML Client, X11)

Describe the solution you'd like
Emulate a touch screen (Not a touchpad)

I've seen there's an open issue for Touch Device, but apparently it's not touch screen but touch pad / drawing tablet.

@fan87 fan87 added the enhancement New feature or request label Dec 19, 2022
@fan87 fan87 closed this as completed Dec 19, 2022
@fan87 fan87 changed the title Touch screen support (xinput) Touch screen support (Not HTML5) Dec 19, 2022
@fan87 fan87 reopened this Dec 19, 2022
@fan87
Copy link
Author

fan87 commented Dec 21, 2022

Touch screen support on seamless mode is broken (Act as mouse but shouldn't), not sure if it has anything to do with Uinput yet
Also touch screen support is broken on ssh X forwarding (Act as mouse), but is not with envioronment variable directly set to remote machine's display

@totaam
Copy link
Collaborator

totaam commented Dec 21, 2022

Touch screen support on seamless mode is broken

You have provided no evidence for this.
Please see the previous comment and provide more information.

not sure if it has anything to do with Uinput yet

Touch device emulation requires uinput.

@fan87
Copy link
Author

fan87 commented Dec 25, 2022

Kinda fixed the issue, now it's complaining unmanaged X11 context once i touch the screen

@totaam
Copy link
Collaborator

totaam commented Dec 26, 2022

Kinda fixed the issue

So you were not using uinput and now you are?

now it's complaining unmanaged X11 context

@fan87 Please include the full message.

@fan87
Copy link
Author

fan87 commented Dec 26, 2022

uinput support is kinda broken (at least in python 3.10). server_util.py line 388

open(uevent_filename, "rb", encoding="latin1").read()
2022-12-26 13:46:19,361 Error: cannot query uinput device path:
2022-12-26 13:46:19,362  binary mode doesn't take an encoding argument

Fixed it by removing encoding, now what happens is unmanaged X11 context

2022-12-26 13:47:25,619 Error: unmanaged X11 context
2022-12-26 13:47:25,620  parse_xi_event
2022-12-26 13:47:25,621    File "/usr/bin/xpra", line 10, in <module>
2022-12-26 13:47:25,621      sys.exit(main(sys.argv[0], sys.argv))
2022-12-26 13:47:25,621    File "/usr/lib/python3.10/site-packages/xpra/scripts/main.py", line 145, in main
2022-12-26 13:47:25,621      return run_mode(script_file, cmdline, err, options, args, mode, defaults)
2022-12-26 13:47:25,621    File "/usr/lib/python3.10/site-packages/xpra/scripts/main.py", line 445, in run_mode
2022-12-26 13:47:25,621      return do_run_mode(script_file, cmdline, error_cb, options, args, mode, defaults)
2022-12-26 13:47:25,622    File "/usr/lib/python3.10/site-packages/xpra/scripts/main.py", line 489, in do_run_mode
2022-12-26 13:47:25,622      return run_client(script_file, cmdline, error_cb, options, args, mode)
2022-12-26 13:47:25,622    File "/usr/lib/python3.10/site-packages/xpra/scripts/main.py", line 1258, in run_client
2022-12-26 13:47:25,622      r = do_run_client(app)
2022-12-26 13:47:25,622    File "/usr/lib/python3.10/site-packages/xpra/scripts/main.py", line 1762, in do_run_client
2022-12-26 13:47:25,622      return app.run()
2022-12-26 13:47:25,622    File "/usr/lib/python3.10/site-packages/xpra/client/gtk_base/gtk_client_base.py", line 153, in run
2022-12-26 13:47:25,622      self.gtk_main()
2022-12-26 13:47:25,622    File "/usr/lib/python3.10/site-packages/xpra/client/gtk_base/gtk_client_base.py", line 159, in gtk_main
2022-12-26 13:47:25,622      Gtk.main()
2022-12-26 13:47:25,622    File "/usr/lib/python3.10/site-packages/gi/overrides/Gtk.py", line 1689, in main
2022-12-26 13:47:25,622      return _Gtk_main(*args, **kwargs)

It spams the stdout so it's performing really slow, I disabled the error output then it doesn't lag anymore, and touch works as mouse.

Did more digging, found out that uinput devices are created, and it's using uinput pointer device instead of xtest pointer device now, but when i click on the screen (touch screen of my linux laptop), its device ID is still -1, which resulted in UInput Pointer Device

Also touch devices are not acting the same touchpad devices, that's why I mentioned not sure if it has anything to do with uinput - because I don't know (and don't think) if touchpad devices is same as touch screen

@fan87
Copy link
Author

fan87 commented Dec 26, 2022

log.txt

@totaam
Copy link
Collaborator

totaam commented Dec 26, 2022

uinput support is kinda broken (at least in python 3.10)

Thanks! That was recent change in the 5.0 development branch, the commit above fixes that.

Error: unmanaged X11 context
parse_xi_event

The next commit should fix this one and restore parsing of XI2 events.

and it's using uinput pointer device instead of xtest pointer device now, but when i click on the screen (touch screen of my linux laptop), its device ID is still -1, which resulted in UInput Pointer Device

I can't remember all the details, but that looks correct.

because I don't know (and don't think) if touchpad devices is same as touch screen

IIRC they're close enough, and it's not easy to differentiate.

@totaam
Copy link
Collaborator

totaam commented Mar 16, 2023

Not sure how useful that's going to be, but there are APIs we can use for simulating touch events in shadow mode: #3750 (comment)
libei claims to have support for touch devices, but I'm not sure yet if this is going to work with X11 (how would it?).

See also #3831

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants