Geis with GLFW and X11

Asked by Amit Nayar on 2015-12-04

I'm using GLFW and X11 as a window manager running on an Arm (Nvidia Tegra TK1).
Also using Geis with Grail backend.

Seems to hang on geis_subscription_activate() after the touch device has been detected by geis (so after geis posts a GEIS_EVENT_DEVICE_AVAILABLE).
If I activate the subscription first (on GEIS_EVENT_INIT_COMPLETE), the subscription activates and the program continues, but all touch screen touches come through as X left mouse clicks.

Digging a bit further into the hang, it looks like Geis calls all the way down to
_geis_grail_activate_for_device_region()
    |> geis_grail_window_grab_store_grab()
         |> XIGrabTouchBegin()

Which takes the X window ID and display ID and XIAllMasterDevices.
I'm a bit stuck at this point!

The window ID is taken from GLFW library: glfwGetX11Display()

Does Geis support GLFW running on top of X11?
It all seems to work fine when running EGL on X11.

Any help would be much appreciated.

Question information

Language:
English Edit question
Status:
Solved
For:
Geis Edit question
Assignee:
No assignee Edit question
Solved by:
Amit Nayar
Solved:
2015-12-10
Last query:
2015-12-10
Last reply:
Stephen M. Webb (bregma) said : #1

I'm unaware of any reason it shouldn't work.

I suspect that if it's hanging trying to grab a touch device, it's because there's already an outstanding grab on the device. Could be GLFW itself maybe?

Amit Nayar (amit-nyr) said : #2

Not sure. I would think it should only be X11 that would need to access the device.
Geis does manage to successfully find the device and report the correct attributes of it. Just seems to be when subscribing after this happens, the XIGrabTouchBegin() call fails.
I would think that GLFW with GL and X11 would be the standard for most linux development which is why it seems strange.

Amit Nayar (amit-nyr) said : #3

Stephen, I've changed the window manager back to EGL with X11 and I'm getting the same results. So the only difference is that it works on X86 and doesn't on ARM.
Do you know of any issues with using multitouch on an ARM? Do you have an idea of which library / area of code could be the issue?
Thanks for your help

Amit Nayar (amit-nyr) said : #4

Problem solved for EGL on ARM (still no solution for GLFW)

I just needed to activate the subscriptions after the geis device connected event.
Thanks!