mirror of
https://github.com/hyprwm/aquamarine.git
synced 2024-11-17 04:56:00 +01:00
buffer: add backendLock
This commit is contained in:
parent
9d7c69cde2
commit
35e00a4a9d
2 changed files with 17 additions and 1 deletions
|
@ -63,11 +63,13 @@ namespace Aquamarine {
|
||||||
|
|
||||||
Hyprutils::Math::Vector2D size;
|
Hyprutils::Math::Vector2D size;
|
||||||
bool opaque = false;
|
bool opaque = false;
|
||||||
|
bool lockedByBackend = false;
|
||||||
|
|
||||||
CAttachmentManager attachments;
|
CAttachmentManager attachments;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
Hyprutils::Signal::CSignal destroy;
|
Hyprutils::Signal::CSignal destroy;
|
||||||
|
Hyprutils::Signal::CSignal backendRelease;
|
||||||
} events;
|
} events;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -1236,6 +1236,11 @@ void Aquamarine::SDRMConnector::applyCommit(const SDRMConnectorCommitData& data)
|
||||||
if (crtc->cursor && data.cursorFB)
|
if (crtc->cursor && data.cursorFB)
|
||||||
crtc->cursor->back = data.cursorFB;
|
crtc->cursor->back = data.cursorFB;
|
||||||
|
|
||||||
|
if (data.mainFB)
|
||||||
|
data.mainFB->buffer->lockedByBackend = true;
|
||||||
|
if (crtc->cursor && data.cursorFB)
|
||||||
|
data.cursorFB->buffer->lockedByBackend = true;
|
||||||
|
|
||||||
pendingCursorFB.reset();
|
pendingCursorFB.reset();
|
||||||
|
|
||||||
if (output->state->state().committed & COutputState::AQ_OUTPUT_STATE_MODE)
|
if (output->state->state().committed & COutputState::AQ_OUTPUT_STATE_MODE)
|
||||||
|
@ -1253,9 +1258,18 @@ void Aquamarine::SDRMConnector::rollbackCommit(const SDRMConnectorCommitData& da
|
||||||
void Aquamarine::SDRMConnector::onPresent() {
|
void Aquamarine::SDRMConnector::onPresent() {
|
||||||
crtc->primary->last = crtc->primary->front;
|
crtc->primary->last = crtc->primary->front;
|
||||||
crtc->primary->front = crtc->primary->back;
|
crtc->primary->front = crtc->primary->back;
|
||||||
|
if (crtc->primary->last && crtc->primary->last->buffer) {
|
||||||
|
crtc->primary->last->buffer->lockedByBackend = false;
|
||||||
|
crtc->primary->last->buffer->events.backendRelease.emit();
|
||||||
|
}
|
||||||
|
|
||||||
if (crtc->cursor) {
|
if (crtc->cursor) {
|
||||||
crtc->cursor->last = crtc->cursor->front;
|
crtc->cursor->last = crtc->cursor->front;
|
||||||
crtc->cursor->front = crtc->cursor->back;
|
crtc->cursor->front = crtc->cursor->back;
|
||||||
|
if (crtc->cursor->last && crtc->cursor->last->buffer) {
|
||||||
|
crtc->cursor->last->buffer->lockedByBackend = false;
|
||||||
|
crtc->cursor->last->buffer->events.backendRelease.emit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue