Commit cebdc1cc authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

screencasting: Properly disable the cursor when it exits the viewport

Otherwise it would glitch


(cherry picked from commit 9208a8eb)
parent ea8b0d96
Pipeline #194125 passed with stage
in 40 minutes and 43 seconds
......@@ -619,10 +619,19 @@ QRect ScreenCastStream::cursorGeometry(Cursor *cursor) const
void ScreenCastStream::sendCursorData(Cursor *cursor, spa_meta_cursor *spa_meta_cursor)
{
if (!cursor || !spa_meta_cursor || !m_cursor.viewport.contains(cursor->pos())) {
if (!cursor || !spa_meta_cursor) {
return;
}
if (!m_cursor.viewport.contains(cursor->pos())) {
spa_meta_cursor->id = 0;
spa_meta_cursor->position.x = -1;
spa_meta_cursor->position.y = -1;
spa_meta_cursor->hotspot.x = -1;
spa_meta_cursor->hotspot.y = -1;
spa_meta_cursor->bitmap_offset = 0;
return;
}
const auto position = (cursor->pos() - m_cursor.viewport.topLeft()) * m_cursor.scale;
spa_meta_cursor->id = 1;
......
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