Commit 2e1880b8 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Fix crash when using kwin on windowed mode

Summary:
Used to get:
`kwin_wayland: kwin/composite.cpp:646: void KWin::Compositor::aboutToSwapBuffers(): Assertion "!m_bufferSwapPending' failed."`

Test Plan: Ran `kwin_wayland --socket dave --output-count 2 konsole`

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20056
parent c795f138
......@@ -289,7 +289,10 @@ void EglWaylandBackend::present()
void EglWaylandBackend::presentOnSurface(EglWaylandOutput *output)
{
output->m_waylandOutput->surface()->setupFrameCallback();
Compositor::self()->aboutToSwapBuffers();
if (!m_swapping) {
m_swapping = true;
Compositor::self()->aboutToSwapBuffers();
}
if (supportsBufferAge()) {
eglSwapBuffers(eglDisplay(), output->m_eglSurface);
......@@ -321,6 +324,7 @@ QRegion EglWaylandBackend::prepareRenderingFrame()
{
eglWaitNative(EGL_CORE_NATIVE_ENGINE);
startRenderTimer();
m_swapping = false;
return QRegion();
}
......
......@@ -109,6 +109,7 @@ private:
WaylandBackend *m_backend;
QVector<EglWaylandOutput*> m_outputs;
bool m_havePlatformBase;
bool m_swapping = false;
friend class EglWaylandTexture;
};
......
Markdown is supported
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