~gerboland/qtmir/small-hooks-change

« back to all changes in this revision

Viewing changes to src/platforms/mirserver/eventbuilder.h

  • Committer: Bileto Bot
  • Author(s): Daniel d'Andrada
  • Date: 2017-03-28 17:12:39 UTC
  • mfrom: (625.1.4 keyState)
  • Revision ID: ci-train-bot@canonical.com-20170328171239-nd8gj4bz4srkgof1
Ensure the window that got a key down also gets the corresponding key up

Otherwise it will be left in a inconsistent state (with a pressed key hanging around).

QQuickWindow's input dispatching doesn't guarantee that for its QQuickItem.
So we have to do it ourselves.

This can happen when qml active focus changes in response to a key press.
Eg: client creates a child window in response to a Ctrl+O. By the time the user
releases the Ctrl, active focus will already be in the child window, so the child window
will get the release event instead of the top-level one. (LP: #1671072)

Approved by: Gerry Boland, Unity8 CI Bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
                                const QList<QTouchEvent::TouchPoint> &qtTouchPoints,
70
70
                                Qt::TouchPointStates /* qtTouchPointStates */,
71
71
                                ulong qtTimestamp);
72
 
private:
73
72
    class EventInfo {
74
73
    public:
75
74
        void store(const MirInputEvent *mirInputEvent, ulong qtTimestamp);
82
81
 
83
82
    EventInfo *findInfo(ulong qtTimestamp);
84
83
 
 
84
private:
85
85
    mir::EventUPtr makeMirEvent(QInputEvent *qtEvent, int x, int y, MirPointerButtons buttons);
86
86
 
87
87