From 0dde8b195fc62e0d05933e094f5ae09bc917cf09 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Fri, 20 Sep 2024 16:45:16 +0200 Subject: wait until tray is available --- src/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index e40f387..cf14cf6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,9 @@ #include #include +#include + +using namespace std::chrono_literals; #include "permissionmanager.hpp" #include "tray.hpp" @@ -42,6 +45,7 @@ main(int argc, char **argv) WebWindow webwindow(url); Tray tray; + bool start_hidden = not app.arguments().contains("--open-at-startup"); for (auto feature : features) { @@ -70,5 +74,10 @@ main(int argc, char **argv) if (start_hidden) { webwindow.hide(); } + + while (!tray.isSystemTrayAvailable()) { + std::this_thread::sleep_for(50ms); + }; + return app.exec(); } -- cgit v1.2.3-70-g09d2