X-Git-Url: https://git.decadent.org.uk/gitweb/?p=videolink.git;a=blobdiff_plain;f=webdvd.cpp;h=26e426062bd6aaa1bca1924cf443dc5f7a88a4ad;hp=31ad122776a154586a14ea9baf4e7642331dcd5a;hb=72534f81da76c6c731c5d688d8485e6d9c9e2c9a;hpb=86602dfc3c0f036cc061277b70607e2631b50229 diff --git a/webdvd.cpp b/webdvd.cpp index 31ad122..26e4260 100644 --- a/webdvd.cpp +++ b/webdvd.cpp @@ -215,6 +215,10 @@ namespace dvd_contents::pgc_ref add_title(const std::string & uri); void load_next_page(); void on_net_state_change(const char * uri, gint flags, guint status); + bool browser_is_busy() const + { + return pending_window_update_ || pending_req_count_; + } bool process_page(); void save_screenshot(); void process_links(nsIPresShell * pres_shell, @@ -407,7 +411,7 @@ namespace pending_window_update_ = false; } - if (pending_req_count_ == 0 && !pending_window_update_) + if (!browser_is_busy()) { try { @@ -455,7 +459,7 @@ namespace // Might need to wait a while for things to load or more // likely for a re-layout. - if (pending_req_count_ > 0) + if (browser_is_busy()) return true; } @@ -714,7 +718,7 @@ namespace // We may have to exit and wait for image loading // to complete, at which point we will be called // again. - if (pending_req_count_ > 0) + if (browser_is_busy()) { state->link_changing = true; page_state_ = state;