Port to asynchronous roundtrip

When a resize is driven client side we wait for the compositor to have a
chance to reconfigure us before submitting the next frame.

Using a blocking round trip caused an issue. Instead block isExposed and
trigger an expose event whilst a sync is in progress.
This commit is contained in:
David Edmundson
2024-02-15 22:19:12 +00:00
parent 176b7648d4
commit c902d638ec
2 changed files with 54 additions and 7 deletions

View File

@ -30,7 +30,7 @@ public:
bool isExposed() const override
{
return m_configured;
return m_configured && !m_waitForSyncCallback;
}
void attachPopup(QtWaylandClient::QWaylandShellSurface *popup) override;
@ -49,6 +49,9 @@ public:
void requestXdgActivationToken(quint32 serial) override;
private:
void requestWaylandSync();
void handleWaylandSyncDone();
void sendExpose();
void zwlr_layer_surface_v1_configure(uint32_t serial, uint32_t width, uint32_t height) override;
void zwlr_layer_surface_v1_closed() override;
@ -57,7 +60,11 @@ private:
QtWaylandClient::QWaylandWindow *m_window;
QSize m_pendingSize;
QString m_activationToken;
bool m_configured = false;
static const wl_callback_listener syncCallbackListener;
struct wl_callback *m_waitForSyncCallback = nullptr;
};
}