Returns the app data if the app is active. Note that this could clash if the same app is started twice and a background thread is slow. */
| 52 | |
| 53 | /** Returns the app data if the app is active. Note that this could clash if the same app is started twice and a background thread is slow. */ |
| 54 | std::shared_ptr<ScreenshotApp> optApp() { |
| 55 | auto appContext = getCurrentAppContext(); |
| 56 | if (appContext != nullptr && appContext->getManifest().appId == manifest.appId) { |
| 57 | return std::static_pointer_cast<ScreenshotApp>(appContext->getApp()); |
| 58 | } else { |
| 59 | return nullptr; |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | static void onStartPressedCallback(lv_event_t* event) { |
| 64 | auto app = optApp(); |
no test coverage detected