~kdub/qtmir/nochange-rebuild

« 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:39 UTC
  • mfrom: (404.3.8 surfaceCursor)
  • Revision ID: ci-train-bot@canonical.com-20151125153839-98vwzxmg8i09zzld
Implemented support for cursors set by client surfaces
Approved by: Lukáš Tinkl

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
    m_shapeToCursorName[Qt::BlankCursor] = "blank";
41
41
    m_shapeToCursorName[Qt::SplitVCursor] = "split_v";
42
42
    m_shapeToCursorName[Qt::SplitHCursor] = "split_h";
43
 
    m_shapeToCursorName[Qt::PointingHandCursor] = "pointing_hand";
 
43
    m_shapeToCursorName[Qt::PointingHandCursor] = "hand";
44
44
    m_shapeToCursorName[Qt::ForbiddenCursor] = "forbidden";
45
45
    m_shapeToCursorName[Qt::WhatsThisCursor] = "whats_this";
46
46
    m_shapeToCursorName[Qt::BusyCursor] = "left_ptr_watch";
47
47
    m_shapeToCursorName[Qt::OpenHandCursor] = "openhand";
48
48
    m_shapeToCursorName[Qt::ClosedHandCursor] = "closedhand";
49
 
    m_shapeToCursorName[Qt::DragCopyCursor] = "copy";
50
 
    m_shapeToCursorName[Qt::DragMoveCursor] = "move";
51
 
    m_shapeToCursorName[Qt::DragLinkCursor] = "link";
 
49
    m_shapeToCursorName[Qt::DragCopyCursor] = "dnd-copy";
 
50
    m_shapeToCursorName[Qt::DragMoveCursor] = "dnd-move";
 
51
    m_shapeToCursorName[Qt::DragLinkCursor] = "dnd-link";
52
52
 
53
53
    connect(Mir::instance(), &Mir::cursorNameChanged, this, &Cursor::setMirCursorName);
54
54
}
60
60
    }
61
61
 
62
62
    if (windowCursor) {
63
 
        m_qtCursorName = m_shapeToCursorName.value(windowCursor->shape(), QString("left_ptr"));
 
63
        if (windowCursor->pixmap().isNull()) {
 
64
            m_qtCursorName = m_shapeToCursorName.value(windowCursor->shape(), QLatin1String("left_ptr"));
 
65
            m_mousePointer->setCustomCursor(QCursor());
 
66
        } else {
 
67
            m_qtCursorName = QLatin1String("custom");
 
68
            m_mousePointer->setCustomCursor(*windowCursor);
 
69
        }
64
70
    } else {
65
71
        m_qtCursorName.clear();
 
72
        m_mousePointer->setCustomCursor(QCursor());
66
73
    }
67
74
 
68
75
    updateMousePointerCursorName();