Skip to content

Commit 656e0ca

Browse files
committed
fix: texture from surface buffer failed
Use client buffer's source as surface buffer. Client buffer is not complete, and might fail to get texture when the source buffer is a shm buffer.
1 parent 64aa339 commit 656e0ca

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/server/kernel/wsurface.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,18 +116,9 @@ void WSurfacePrivate::updateOutputs()
116116

117117
void WSurfacePrivate::setBuffer(qw_buffer *newBuffer)
118118
{
119-
if (buffer) {
120-
if (auto clientBuffer = qw_client_buffer::get(*buffer)) {
121-
Q_ASSERT(clientBuffer->handle()->n_ignore_locks > 0);
122-
clientBuffer->handle()->n_ignore_locks--;
123-
}
124-
}
125-
126119
if (newBuffer) {
127-
if (auto clientBuffer = qw_client_buffer::get(*newBuffer)) {
128-
clientBuffer->handle()->n_ignore_locks++;
129-
}
130-
120+
auto clientBuffer = qw_client_buffer::get(*newBuffer);
121+
auto sourceBuffer = clientBuffer ? qw_buffer::from(clientBuffer->handle()->source) : newBuffer;
131122
newBuffer->lock();
132123
buffer.reset(newBuffer);
133124
} else {

0 commit comments

Comments
 (0)