InverseMouseArea does not work with TouchEvents

Bug #1250412 reported by Albert Astals Cid
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu UI Toolkit
Invalid
Undecided
Unassigned

Bug Description

When debugging a problem with InverseMouseArea use in Unity8 I have come to the realization that what InverseMouseAreaType::eventFilter is getting is only TouchEvents and since there's no filter for them they seem to be ignored.

One could argue that this is a bug in QQuickWindowPrivate::translateTouchToMouse that should make sure the synthetized mouse events from the touch events pass through the event filters, but not really sure.

Thoughts?

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

QTouchEvents do not go through QQuickItem::event and therefore they cannot be filtered like that. QQuickWindows feeds them directly to QQuickEvent::touchEvent. Inconsistent, if you ask me.

Revision history for this message
Albert Astals Cid (aacid) wrote :

InverseMouseAreaType is filtering events at the application level, so InverseMouseAreaType::eventFilter gets the touch events.

So to rephrase what I said, we can either catch and process the touchevents at InverseMouseAreaType::eventFilter where we do have them or say QQuickWindowPrivate::translateTouchToMouse to be buggy by not reinserting the mouseevents at the global level and fix it that way.

Obviously catching them at the InverseMouseAreaType::eventFilter is "the easy route"

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

FYI: I'll propose a patch to make QTouchEvents go through the item's event() method (and therefore make it "filterable") like any other QEvent. Let's see if that goes through...

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

There's actually a QT bug about it: https://bugreports.qt-project.org/browse/QTBUG-32004

Revision history for this message
Zsombor Egri (zsombi) wrote :

If touch events will be converted into mouse events, then InverseMouseArea will also deal with those.

tags: added: inversemousearea
Revision history for this message
Zsombor Egri (zsombi) wrote :

Fixed in Qt5.1.0

Changed in ubuntu-ui-toolkit:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.