summaryrefslogtreecommitdiff
path: root/hyprtester/src/tests/clients/pointer-scroll.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'hyprtester/src/tests/clients/pointer-scroll.cpp')
-rw-r--r--hyprtester/src/tests/clients/pointer-scroll.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/hyprtester/src/tests/clients/pointer-scroll.cpp b/hyprtester/src/tests/clients/pointer-scroll.cpp
index 2ea93a14..d54d82de 100644
--- a/hyprtester/src/tests/clients/pointer-scroll.cpp
+++ b/hyprtester/src/tests/clients/pointer-scroll.cpp
@@ -42,6 +42,7 @@ static bool startClient(SClient& client) {
client.readFd = CFileDescriptor(pipeFds2[0]);
client.proc->setStdoutFD(pipeFds2[1]);
+ const int COUNT_BEFORE = Tests::windowCount();
client.proc->runAsync();
close(pipeFds1[0]);
@@ -62,7 +63,16 @@ static bool startClient(SClient& client) {
}
// wait for window to appear
- std::this_thread::sleep_for(std::chrono::milliseconds(5000));
+ int counter = 0;
+ while (Tests::processAlive(client.proc->pid()) && Tests::windowCount() == COUNT_BEFORE) {
+ counter++;
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
+
+ if (counter > 50) {
+ NLog::log("{}pointer-scroll client took too long to open", Colors::RED);
+ return false;
+ }
+ }
if (getFromSocket(std::format("/dispatch setprop pid:{} no_anim 1", client.proc->pid())) != "ok") {
NLog::log("{}Failed to disable animations for client window", Colors::RED, ret);