Skip to content

Commit dc55236

Browse files
committed
Small changes to hopefully fix the weird bug I'm getting
1 parent 3d570a4 commit dc55236

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

main.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,9 @@ int main(int argc, char* argv[]) {
421421
debug("This program requires macOS to run.") // No Timmy, this doesn't work on Windows 11
422422
#endif
423423

424-
debug("Starting app...");
424+
auto versionTypeString = DEBUG ? (BETA ? "Beta (Debug)" : "Debug") : (BETA ? "Beta" : "Release");
425+
debug("Starting ItlwmCLI version {} {}", VERSION, versionTypeString);
426+
425427
exec = ghc::filesystem::absolute(argv[0]).parent_path();
426428
settingsfile = exec / "ItlwmCLI.settings.json"; // File for settings
427429

@@ -582,7 +584,7 @@ int main(int argc, char* argv[]) {
582584
return vbox({
583585
// Header
584586
vbox({
585-
text(fmt::format("ItlwmCLI {} {} by Calebh101", VERSION, DEBUG ? (BETA ? "Debug (Beta)" : "Debug") : (BETA ? "Beta" : "Release"))) | center, // We tell the user if the program is a beta release, a debug binary, or both
587+
text(fmt::format("ItlwmCLI {} {} by Calebh101", VERSION, versionTypeString)) | center, // We tell the user if the program is a beta release, a debug binary, or both
586588
text(fmt::format("Powered by itlwm {}", network_platform_info_available ? platformInfo->driver_info_str: "Unknown")) | center,
587589
}) | border | size(HEIGHT, EQUAL, HEADER_LINES + 2),
588590
// Body
@@ -660,24 +662,23 @@ int main(int argc, char* argv[]) {
660662
return false;
661663
});
662664

665+
debug("Starting services...");
666+
running = true;
667+
663668
if (CONSTANT_REFRESH_INTERVAL > 0) {
664669
debug("Allowing constant refresh...");
665670

666671
refresher = std::thread([&] {
667-
while (true) {
672+
while (running) {
668673
std::this_thread::sleep_for(std::chrono::milliseconds(CONSTANT_REFRESH_INTERVAL));
669-
670-
if (running) {
671-
screen.PostEvent(Event::Custom);
672-
iteration++;
673-
}
674+
screen.PostEvent(Event::Custom);
675+
iteration++;
674676
}
675677
});
676678
}
677679

678680
debug("Starting application...");
679681
if (refresher.joinable()) refresher.detach();
680-
running = true;
681682
screen.Loop(interactive);
682683
running = false;
683684
api_terminate();

0 commit comments

Comments
 (0)