Skip to content

Commit 760211a

Browse files
committed
re-open windows and multiple webui_wait() calls
Now it's possible to do something like: ```c webui_show(my_window, "<html><head><script src=\"webui.js\"></script></head> Hello World 1! </html>"); webui_wait(); webui_show(my_window, "<html><head><script src=\"webui.js\"></script></head> Hello World 2! </html>"); webui_wait(); ```
1 parent ff87f48 commit 760211a

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/webui.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10078,9 +10078,16 @@ static WEBUI_THREAD_SERVER_START {
1007810078
// Exit app only if user called `webui_wait()` and
1007910079
// now all window's threads and servers are closed.
1008010080
if (_webui.is_main_run) {
10081-
// Stop all threads
10082-
_webui.ui = false;
10083-
_webui_mutex_app_is_exit_now(WEBUI_MUTEX_SET_TRUE);
10081+
10082+
// Stop all threads and exit app
10083+
// _webui.ui = false;
10084+
// _webui_mutex_app_is_exit_now(WEBUI_MUTEX_SET_TRUE);
10085+
10086+
// Reset single client cookie flag, so user
10087+
// can call `webui_show()` again if needed.
10088+
_webui.cookies_single_set[win->num] = false;
10089+
win->current_browser = 0;
10090+
1008410091
// Break main loop
1008510092
_webui_condition_signal(&_webui.condition_wait);
1008610093
#ifdef __APPLE__

0 commit comments

Comments
 (0)