Skip to content

Commit

Permalink
do not set cursor planeProps unless smth changed
Browse files Browse the repository at this point in the history
  • Loading branch information
UjinT34 committed Nov 11, 2024
1 parent 545f506 commit 8ed37dc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/aquamarine/output/Output.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ namespace Aquamarine {
AQ_OUTPUT_STATE_EXPLICIT_IN_FENCE = (1 << 8),
AQ_OUTPUT_STATE_EXPLICIT_OUT_FENCE = (1 << 9),
AQ_OUTPUT_STATE_CTM = (1 << 10),
AQ_OUTPUT_STATE_CURSOR = (1 << 11),
};

struct SInternalState {
Expand Down
4 changes: 4 additions & 0 deletions src/backend/drm/DRM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1657,6 +1657,7 @@ bool Aquamarine::CDRMOutput::setCursor(SP<IBuffer> buffer, const Vector2D& hotsp
if (!connector->crtc)
return false;

state->internalState.committed |= COutputState::AQ_OUTPUT_STATE_CURSOR;
if (!buffer)
setCursorVisible(false);
else {
Expand Down Expand Up @@ -1731,6 +1732,9 @@ bool Aquamarine::CDRMOutput::setCursor(SP<IBuffer> buffer, const Vector2D& hotsp
void Aquamarine::CDRMOutput::moveCursor(const Vector2D& coord, bool skipSchedule) {
cursorPos = coord;
// cursorVisible = true;
if (!skipSchedule)
state->internalState.committed |= COutputState::AQ_OUTPUT_STATE_CURSOR;

backend->impl->moveCursor(connector, skipSchedule);
}

Expand Down
2 changes: 1 addition & 1 deletion src/backend/drm/impl/Atomic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void Aquamarine::CDRMAtomicRequest::addConnector(Hyprutils::Memory::CSharedPoint
if (connector->crtc->primary->props.fb_damage_clips)
add(connector->crtc->primary->id, connector->crtc->primary->props.fb_damage_clips, data.atomic.fbDamage);

if (connector->crtc->cursor) {
if (connector->crtc->cursor && STATE.committed & COutputState::AQ_OUTPUT_STATE_CURSOR) {
if (!connector->output->cursorVisible)
planeProps(connector->crtc->cursor, nullptr, 0, {});
else
Expand Down

0 comments on commit 8ed37dc

Please sign in to comment.