[epiphany/mcatanzaro/modified-forms-check: 2/2] window: fix modified forms check when closing single tab



commit 7f07272dad225fc58cb64379a28229380866adb4
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Tue Jan 8 20:07:19 2019 -0600

    window: fix modified forms check when closing single tab
    
    This regressed in e14780a2565cd4d40486427b0fa57edd8dfe1398. I tested
    this commit extensively with a broken web process to ensure it's
    possible to close tabs with a misbehaving web process, but failed to
    test with a well-behaved web process. The tab now closes after the
    timeout, while the modified forms dialog is being shown, without waiting
    for user input. Oops. Got to cancel the timeout once we've received our
    response from the web process.

 src/ephy-window.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index d1cf8f7cf..d73f5a7e7 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2770,6 +2770,9 @@ tab_has_modified_forms_cb (EphyWebView             *view,
 
   has_modified_forms = ephy_web_view_has_modified_forms_finish (view, result, NULL);
 
+  /* Cancel timer so it doesn't close while waiting for the user. */
+  g_source_remove (data->id);
+
   if (data->id != 0 &&
       data->window != NULL &&
       data->embed != NULL &&
@@ -2777,6 +2780,7 @@ tab_has_modified_forms_cb (EphyWebView             *view,
     ephy_window_close_tab (data->window, data->embed);
   }
 
+  data->id = 0;
   tab_has_modified_forms_data_free (data);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]