tests: Send frame callbacks by default

Currently we have special handling for wl-shell to automatically
respond to frame callbacks in the mock compositor.

With the framecallback timer this results in flaky tests as the window
becomes unexposed.

Pick-to: 6.6
Change-Id: I2add44d59ba26368c031a381849891f49764bfb5
Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
David Edmundson 2023-06-15 15:07:32 +01:00
parent 4a7e459dc7
commit 5e47af01b4
4 changed files with 12 additions and 0 deletions

View File

@ -23,6 +23,7 @@ public:
{ {
exec([this] { exec([this] {
m_config.autoConfigure = true; m_config.autoConfigure = true;
m_config.autoFrameCallback = false; // for cursor animation test
removeAll<Seat>(); removeAll<Seat>();

View File

@ -43,6 +43,9 @@ DefaultCompositor::DefaultCompositor(CompositorType t, int socketFd)
// Pretend we made a copy of the buffer and just release it immediately // Pretend we made a copy of the buffer and just release it immediately
surface->m_committed.buffer->send_release(); surface->m_committed.buffer->send_release();
} }
if (m_config.autoFrameCallback) {
surface->sendFrameCallbacks();
}
if (m_config.autoEnter && get<Output>() && surface->m_outputs.empty()) if (m_config.autoEnter && get<Output>() && surface->m_outputs.empty())
surface->sendEnter(get<Output>()); surface->sendEnter(get<Output>());
wl_display_flush_clients(m_display); wl_display_flush_clients(m_display);

View File

@ -61,6 +61,7 @@ public:
bool autoEnter = true; bool autoEnter = true;
bool autoRelease = true; bool autoRelease = true;
bool autoConfigure = false; bool autoConfigure = false;
bool autoFrameCallback = true;
} m_config; } m_config;
void resetConfig() { exec([&] { m_config = Config{}; }); } void resetConfig() { exec([&] { m_config = Config{}; }); }
}; };

View File

@ -12,6 +12,8 @@ using namespace MockCompositor;
class tst_surface : public QObject, private DefaultCompositor class tst_surface : public QObject, private DefaultCompositor
{ {
Q_OBJECT Q_OBJECT
public:
explicit tst_surface();
private slots: private slots:
void cleanup() { QTRY_VERIFY2(isClean(), qPrintable(dirtyMessage())); } void cleanup() { QTRY_VERIFY2(isClean(), qPrintable(dirtyMessage())); }
void createDestroySurface(); void createDestroySurface();
@ -26,6 +28,11 @@ private slots:
void createSubsurfaceForHiddenParent(); void createSubsurfaceForHiddenParent();
}; };
tst_surface::tst_surface()
{
m_config.autoFrameCallback = false;
}
void tst_surface::createDestroySurface() void tst_surface::createDestroySurface()
{ {
QWindow window; QWindow window;