Stop mouse events from interfering with tablet events
AbandonedPublic

Authored by abrahams on Feb 20 2016, 2:10 AM.

Details

Reviewers
scottpetrovic
Summary

I see a similar fix being done with touch events. Tablet events have the same issue. When tablet press and tablet release events get fired, there are also mouse press and mouse release events that get fired as well.

The issue I came across was that while holding Spacebar, you could only pan one time. After that, the cursor turned back into a brush - even though the Spacebar is still held down.

I am setting the tabletevent flag to false on the mouse release event. Why?

Because the mouse release event gets called after the tablet release. If you set the value to false in the tablet release event, the mouse release event will get called as it thinks there is no tablet event. The problem will show itself then.

I am not sure if this is the best coding solution, but it fixes the issue and you should get the idea.

Test Plan

Start Krita with a new document

Hold down space bar and pan with a tablet pen

release the tablet pen, but continue holding down Spacebar.

You should be able to continue panning

Diff Detail

Repository
R37 Krita
Lint
Lint Skipped
Unit
Unit Tests Skipped
scottpetrovic retitled this revision from to Stop mouse events from interfering with tablet events.
scottpetrovic updated this object.
scottpetrovic edited the test plan for this revision. (Show Details)
scottpetrovic added a reviewer: abrahams.
scottpetrovic set the repository for this revision to R37 Krita.
scottpetrovic added a project: Krita.
Restricted Application added a subscriber: woltherav. ยท View Herald TranscriptFeb 20 2016, 2:10 AM
abrahams accepted this revision.Mar 8 2016, 3:19 PM
abrahams edited edge metadata.

Hi Scott - there was something like this in the 2.9 code, I pushed a patch that uses an existing function ignoringQtCursorEvents() which right now just tracks the same thing as the variable isTabletEventStarted.

The only thing I was worried about is we don't have a guarantee the tablet event necessarily comes before the mouse event. So we might get tablet events masking mouse events they shouldn't, or we could still have a mouse press event get through the filter twice, since the mouse event arrived before the tablet event. Regardless, if this patch fixes the panning behavior for you, it doesn't change anything in my machine.

This revision is now accepted and ready to land.Mar 8 2016, 3:19 PM
abrahams commandeered this revision.Mar 8 2016, 3:20 PM
abrahams edited reviewers, added: scottpetrovic; removed: abrahams.

Taking over with rKRITAd2706d879ca345e56465465ff8046a943c60173e

This revision now requires review to proceed.Mar 8 2016, 3:20 PM
abrahams abandoned this revision.Mar 8 2016, 3:21 PM