~mterry/qtmir/warn-on-xapp

« back to all changes in this revision

Viewing changes to src/platforms/mirserver/cursor.cpp

  • Committer: CI Train Bot
  • Author(s): Daniel d'Andrada
  • Date: 2015-11-25 15:38:50 UTC
  • mfrom: (410.1.3 fixWheel)
  • Revision ID: ci-train-bot@canonical.com-20151125153850-yt52ag8eyctqz95s
Forward Mir mouse wheel events to the shell cursor Fixes: #1497091
Approved by: Lukáš Tinkl

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
    return ok;
117
117
}
118
118
 
 
119
bool Cursor::handleWheelEvent(ulong timestamp, QPoint angleDelta, Qt::KeyboardModifiers modifiers)
 
120
{
 
121
    QMutexLocker locker(&m_mutex);
 
122
 
 
123
    if (!m_mousePointer || !m_mousePointer->isVisible()) {
 
124
        return false;
 
125
    }
 
126
 
 
127
    // Must not be called directly as we're most likely not in Qt's GUI (main) thread.
 
128
    bool ok = QMetaObject::invokeMethod(m_mousePointer, "handleWheelEvent", Qt::AutoConnection,
 
129
        Q_ARG(ulong, timestamp),
 
130
        Q_ARG(QPoint, angleDelta),
 
131
        Q_ARG(Qt::KeyboardModifiers, modifiers));
 
132
 
 
133
    if (!ok) {
 
134
        qCWarning(QTMIR_MIR_INPUT) << "Failed to invoke MousePointer::handleMouseEvent";
 
135
    }
 
136
 
 
137
    return ok;
 
138
}
 
139
 
119
140
void Cursor::setPos(const QPoint &pos)
120
141
{
121
142
    if (!m_mousePointer) {