Skip to content

Commit

Permalink
skip extra frames for hw cursors
Browse files Browse the repository at this point in the history
  • Loading branch information
UjinT34 committed Jul 25, 2024
1 parent 4f7963f commit 3d3955f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/managers/AnimationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void CAnimationManager::tick() {

// manually schedule a frame
if (PMONITOR)
g_pCompositor->scheduleFrameForMonitor(PMONITOR, Aquamarine::IOutput::AQ_SCHEDULE_CURSOR_SHAPE);
g_pCompositor->scheduleFrameForMonitor(PMONITOR, Aquamarine::IOutput::AQ_SCHEDULE_ANIMATION);
}

// do it here, because if this alters the animation vars deque we would be in trouble above.
Expand Down
7 changes: 4 additions & 3 deletions src/managers/PointerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ void CPointerManager::onCursorMoved() {
continue;

const auto CURSORPOS = getCursorPosForMonitor(m);
m->output->moveCursor(CURSORPOS);
m->output->moveCursor(CURSORPOS, m->shouldSkipScheduleFrameOnMouseEvent());
}
}

Expand All @@ -310,7 +310,7 @@ bool CPointerManager::attemptHardwareCursor(SP<CPointerManager::SMonitorPointerS
return false;

const auto CURSORPOS = getCursorPosForMonitor(state->monitor.lock());
state->monitor->output->moveCursor(CURSORPOS);
state->monitor->output->moveCursor(CURSORPOS, state->monitor->shouldSkipScheduleFrameOnMouseEvent());

auto texture = getCurrentCursorTexture();

Expand Down Expand Up @@ -353,7 +353,8 @@ bool CPointerManager::setHWCursorBuffer(SP<SMonitorPointerState> state, SP<Aquam

state->cursorFrontBuffer = buf;

g_pCompositor->scheduleFrameForMonitor(state->monitor.get(), Aquamarine::IOutput::AQ_SCHEDULE_CURSOR_SHAPE);
if (!state->monitor->shouldSkipScheduleFrameOnMouseEvent())
g_pCompositor->scheduleFrameForMonitor(state->monitor.get(), Aquamarine::IOutput::AQ_SCHEDULE_CURSOR_SHAPE);

return true;
}
Expand Down

0 comments on commit 3d3955f

Please sign in to comment.