Drop now defunct code to sync resizes

This code was designed to make sure we didn't commit new buffers whilst
we were waiting for a configure. The way this worked failed in 6 after
kwin does not reply to desired_size changes immediately.

It is uneeded after kwin commit "wayland: Avoid rearranging layer
surfaces when wl_surface size changes" which means if we do submit
frames between size change requests, they'll be ignored. Meaning the
client will eventually get a configure event at the right size.
This commit is contained in:
David Edmundson 2024-04-11 17:57:14 +01:00
parent e8594be884
commit 2ac46d8d9d
2 changed files with 1 additions and 38 deletions

View File

@ -71,9 +71,6 @@ QWaylandLayerSurface::QWaylandLayerSurface(QWaylandLayerShellIntegration *shell,
QWaylandLayerSurface::~QWaylandLayerSurface()
{
if (m_waitForSyncCallback) {
wl_callback_destroy(m_waitForSyncCallback);
}
destroy();
}
@ -173,7 +170,6 @@ void QWaylandLayerSurface::setWindowGeometry(const QRect &geometry)
}
setDesiredSize(geometry.size());
requestWaylandSync();
}
bool QWaylandLayerSurface::requestActivate()
@ -224,34 +220,6 @@ void QWaylandLayerSurface::requestXdgActivationToken(quint32 serial)
connect(tokenProvider, &QWaylandXdgActivationTokenV1::done, tokenProvider, &QObject::deleteLater);
}
const wl_callback_listener QWaylandLayerSurface::syncCallbackListener = {
.done = [](void *data, struct wl_callback *callback, uint32_t time){
Q_UNUSED(time);
wl_callback_destroy(callback);
QWaylandLayerSurface *layerSurface = static_cast<QWaylandLayerSurface *>(data);
layerSurface->m_waitForSyncCallback = nullptr;
layerSurface->sendExpose();
}
};
void QWaylandLayerSurface::requestWaylandSync()
{
if (m_waitForSyncCallback) {
return;
}
m_waitForSyncCallback = wl_display_sync(m_window->display()->wl_display());
wl_callback_add_listener(m_waitForSyncCallback, &syncCallbackListener, this);
}
void QWaylandLayerSurface::handleWaylandSyncDone()
{
if (!window()->isExposed()) {
return;
}
sendExpose();
}
void QWaylandLayerSurface::sendExpose()
{
#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0)

View File

@ -30,7 +30,7 @@ public:
bool isExposed() const override
{
return m_configured && !m_waitForSyncCallback;
return m_configured;
}
void attachPopup(QtWaylandClient::QWaylandShellSurface *popup) override;
@ -50,8 +50,6 @@ 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;
@ -64,9 +62,6 @@ private:
bool m_configured = false;
bool m_configuring = false;
static const wl_callback_listener syncCallbackListener;
struct wl_callback *m_waitForSyncCallback = nullptr;
};
}