Commit 7372efff authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

platforms/drm: Remove redundant args in DrmBackend::moveCursor()

Similar to the cursor image, the cursor position can be retrieved by
checking Cursors::self()->currentCursor()->pos().
parent 73f335ad
......@@ -171,15 +171,13 @@ void DrmBackend::reactivate()
}
m_active = true;
if (!usesSoftwareCursor()) {
Cursor* cursor = Cursors::self()->mouse();
const QPoint cp = cursor->pos() - cursor->hotspot();
for (auto it = m_outputs.constBegin(); it != m_outputs.constEnd(); ++it) {
DrmOutput *o = *it;
// only relevant in atomic mode
o->m_modesetRequested = true;
o->m_crtc->blank();
o->showCursor();
o->moveCursor(cursor, cp);
o->moveCursor();
}
}
// restart compositor
......@@ -561,7 +559,7 @@ void DrmBackend::updateCursor()
setCursor();
moveCursor(cursor, cursor->pos());
moveCursor();
}
void DrmBackend::doShowCursor()
......@@ -579,13 +577,13 @@ void DrmBackend::doHideCursor()
}
}
void DrmBackend::moveCursor(Cursor *cursor, const QPoint &pos)
void DrmBackend::moveCursor()
{
if (isCursorHidden() || usesSoftwareCursor()) {
return;
}
for (auto it = m_outputs.constBegin(); it != m_outputs.constEnd(); ++it) {
(*it)->moveCursor(cursor, pos);
(*it)->moveCursor();
}
}
......
......@@ -100,7 +100,7 @@ private:
bool updateOutputs();
void setCursor();
void updateCursor();
void moveCursor(Cursor *cursor, const QPoint &pos);
void moveCursor();
void initCursor();
void readOutputsConfiguration();
void writeOutputsConfiguration();
......
......@@ -152,12 +152,13 @@ void DrmOutput::updateCursor()
p.end();
}
void DrmOutput::moveCursor(Cursor *cursor, const QPoint &globalPos)
void DrmOutput::moveCursor()
{
Cursor *cursor = Cursors::self()->currentCursor();
const QMatrix4x4 hotspotMatrix = logicalToNativeMatrix(cursor->rect(), scale(), transform());
const QMatrix4x4 monitorMatrix = logicalToNativeMatrix(geometry(), scale(), transform());
QPoint pos = monitorMatrix.map(globalPos);
QPoint pos = monitorMatrix.map(cursor->pos());
pos -= hotspotMatrix.map(cursor->hotspot());
drmModeMoveCursor(m_gpu->fd(), m_crtc->id(), pos.x(), pos.y());
......
......@@ -46,7 +46,7 @@ public:
bool showCursor();
bool hideCursor();
void updateCursor();
void moveCursor(Cursor *cursor, const QPoint &globalPos);
void moveCursor();
bool init(drmModeConnector *connector);
bool present(DrmBuffer *buffer);
void pageFlipped();
......
Supports Markdown
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