[Interest] QtWebEngine Linux navigator object

Alexandru Croitor alexandru.croitor at qt.io
Wed Sep 13 10:31:31 CEST 2017

> On 13. Sep 2017, at 08:41, Johannes Pointner <h4nn35.work at gmail.com> wrote:
> Hi Alexandru,
> thanks for the hint. I added a few debug messages and saw that the
> chromium code doesn't know that there is a touch device
> available(touch_device_linux.cc:IsTouchDevicePresent() ) -> so
> maxTouchPoints returns obviously zero. Also the InputDeviceManager has
> no keyboard or mouse device.
> So I suspect that under Linux Qt gets the information about the input
> devices and the chromium part never gets the events about the input
> devices? Could this be the case?

Afaik we don't pass information about touch devices from Qt to Chromium. Chromium detects them by itself.
Obviously the detection code will be different between Qt and Chromium, thus different results. It is possible that we are also not calling some code that Chromium expects us to call to properly detect touch devices. It's hard to say. You'll have to dive into the code with a debugger and figure that out.

> Also I think I know why this works on Windows, because they don't use
> there the InputDeviceManager to get this information instead they call
> system functions.
> On Fri, Sep 8, 2017 at 1:55 PM, Alexandru Croitor
> <alexandru.croitor at qt.io> wrote:
>> Hi,
>> The relevant code that finds the maxTouchPoints value is int qtwebengine/src/3rdparty/chromium/ui/base/touch/touch_device_linux.cc inside the MaxTouchPoints() function.
>> That function iterates over the available touchscreens (not touchpads though). Thus my initial guess is that the touchscreen is not detected for some reason. I would try to find where the list of touchscreen is populated and work from there.
>>> On 8. Sep 2017, at 13:33, Johannes Pointner <h4nn35.work at gmail.com> wrote:
>>> Hi,
>>> I'm trying to get the info from the browser if the device supports multitouch.
>>> There is a navigator object maxTouchPoints
>>> (https://developer.mozilla.org/en-US/docs/Web/API/Navigator/maxTouchPoints)
>>> which would do the trick.
>>> This works with Chromium in Linux and with Chrome and QtWebEngine in
>>> Windows but not with the QtWebEngine in Linux (ArchLinux).
>>> Is this supported by the QtWebEngine under Linux?
>>> Is there something I missed (config build flag maybe)?
>>> Thanks,
>>> Hannes
>>> _______________________________________________
>>> Interest mailing list
>>> Interest at qt-project.org
>>> http://lists.qt-project.org/mailman/listinfo/interest

More information about the Interest mailing list