Skip to content

Commit

Permalink
mangoapp: fix mangoapp hide/show for the second time
Browse files Browse the repository at this point in the history
  • Loading branch information
17314642 authored and flightlessmango committed Feb 1, 2025
1 parent 86d2010 commit e6b255e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,17 @@ int main(int, char**)
for (auto gpu : gpus->available_gpus)
gpu->pause();

std::unique_lock<std::mutex> lk(mangoapp_m);
mangoapp_cv.wait(lk, []{return !params.no_display;});
// If mangoapp is hidden, using mangoapp_cv.wait() causes a hang.
// Because of this hang, we can't detect if the user presses R_SHIFT + F12,
// which prevents mangoapp from being unhidden.
// To address this, replace mangoapp_cv.wait() with sleep().
//
// If severe power usage issues arise, find an alternative solution.

// std::unique_lock<std::mutex> lk(mangoapp_m);
// mangoapp_cv.wait(lk, []{return !params.no_display;});
} else {
usleep(100000);
}
}

Expand Down

0 comments on commit e6b255e

Please sign in to comment.