Skip to content

Commit bdcc8ff

Browse files
committed
New API - webui_wait_async
1 parent 796dc3f commit bdcc8ff

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

include/webui.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ extern "C" {
8888
#include <signal.h>
8989
#include <sys/socket.h>
9090
#include <sys/time.h>
91+
#include <sys/stat.h>
9192
#include <sys/inotify.h>
9293
#include <unistd.h>
9394
#include <ifaddrs.h>
@@ -448,6 +449,18 @@ WEBUI_EXPORT bool webui_browser_exist(size_t browser);
448449
*/
449450
WEBUI_EXPORT void webui_wait(void);
450451

452+
/**
453+
* @brief Wait asynchronously until all opened windows get closed.
454+
* Note: In WebView mode, you need to call this from the main thread.
455+
*
456+
* @return Returns True if more windows are still opened, False otherwise.
457+
*
458+
* @example while (webui_wait_async()) {
459+
* // Your main thread code here
460+
* }
461+
*/
462+
WEBUI_EXPORT bool webui_wait_async(void);
463+
451464
/**
452465
* @brief Close a specific window only. The window object will still exist.
453466
* All clients.

0 commit comments

Comments
 (0)