Commit 317bc74c authored by Vlad Zahorodnii's avatar Vlad Zahorodnii Committed by Vlad Zahorodnii
Browse files

[wayland] Simplify WaylandCursorImage

Cached cursor lookup tables aren't used anywhere so drop relevant methods
that populate those tables in order to make the code simpler.
parent c10fe06d
......@@ -973,8 +973,6 @@ CursorImage::CursorImage(PointerInputRedirection *parent)
m_surfaceRenderedTimer.start();
connect(&m_waylandImage, &WaylandCursorImage::themeChanged, this, [this] {
m_cursors.clear();
m_cursorsByName.clear();
loadThemeCursor(Qt::ArrowCursor, &m_fallbackCursor);
updateDecorationCursor();
updateMoveResize();
......@@ -1262,12 +1260,12 @@ void CursorImage::updateDragCursor()
void CursorImage::loadThemeCursor(CursorShape shape, WaylandCursorImage::Image *image)
{
m_waylandImage.loadThemeCursor(shape, m_cursors, image);
m_waylandImage.loadThemeCursor(shape, image);
}
void CursorImage::loadThemeCursor(const QByteArray &shape, WaylandCursorImage::Image *image)
{
m_waylandImage.loadThemeCursor(shape, m_cursorsByName, image);
m_waylandImage.loadThemeCursor(shape, image);
}
template <typename T>
......@@ -1302,18 +1300,6 @@ void WaylandCursorImage::loadThemeCursor(const T &shape, Image *image)
*image = {img, QPoint(hotSpotX, hotSpotY)};
}
template <typename T>
void WaylandCursorImage::loadThemeCursor(const T &shape, QHash<T, Image> &cursors, Image *image)
{
auto it = cursors.constFind(shape);
if (it == cursors.constEnd()) {
loadThemeCursor(shape, image);
cursors.insert(shape, *image);
} else {
*image = it.value();
}
}
void CursorImage::reevaluteSource()
{
if (waylandServer()->seat()->isDragPointer()) {
......
......@@ -189,9 +189,6 @@ public:
template <typename T>
void loadThemeCursor(const T &shape, Image *image);
template <typename T>
void loadThemeCursor(const T &shape, QHash<T, Image> &cursors, Image *image);
Q_SIGNALS:
void themeChanged();
......@@ -253,8 +250,6 @@ private:
WaylandCursorImage::Image m_fallbackCursor;
WaylandCursorImage::Image m_moveResizeCursor;
WaylandCursorImage::Image m_windowSelectionCursor;
QHash<CursorShape, WaylandCursorImage::Image> m_cursors;
QHash<QByteArray, WaylandCursorImage::Image> m_cursorsByName;
QElapsedTimer m_surfaceRenderedTimer;
struct {
WaylandCursorImage::Image cursor;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment