Changeset 221819 in webkit
- Timestamp:
- Sep 9, 2017 8:31:21 AM (7 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r221814 r221819 1 2017-09-09 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 MiniBrowser closes tab instead of window on close signal 4 https://bugs.webkit.org/show_bug.cgi?id=176587 5 6 Reviewed by Carlos Garcia Campos. 7 8 This has been broken since we added support for multiple tabs. We need to run try_close for 9 every open tab, not just the current one. If there are no onbeforeonload handlers then all 10 tabs will close; if there are some, then they'll be respected, but the remaining tabs will 11 be closed. 12 13 Note that we cannot simply iterate through the tabs of the GtkNotebook, as we'd be deleting 14 tabs as we go, so save all the tabs into a separate list and then try to close each in turn. 15 16 * MiniBrowser/gtk/BrowserWindow.c: 17 (browserWindowTryClose): 18 (browserWindowDeleteEvent): 19 1 20 2017-09-09 Zan Dobersek <zdobersek@igalia.com> 2 21 -
trunk/Tools/MiniBrowser/gtk/BrowserWindow.c
r217620 r221819 1046 1046 } 1047 1047 1048 static void browserWindowTryClose(BrowserWindow *window) 1049 { 1050 GSList *webViews = NULL; 1051 int n = gtk_notebook_get_n_pages(GTK_NOTEBOOK(window->notebook)); 1052 int i; 1053 1054 for (i = 0; i < n; ++i) { 1055 BrowserTab *tab = (BrowserTab *)gtk_notebook_get_nth_page(GTK_NOTEBOOK(window->notebook), i); 1056 webViews = g_slist_prepend(webViews, browser_tab_get_web_view(tab)); 1057 } 1058 1059 GSList *link; 1060 for (link = webViews; link; link = link->next) 1061 webkit_web_view_try_close(link->data); 1062 } 1063 1048 1064 static gboolean browserWindowDeleteEvent(GtkWidget *widget, GdkEventAny* event) 1049 1065 { 1050 1066 BrowserWindow *window = BROWSER_WINDOW(widget); 1051 1067 browserWindowSaveSession(window); 1052 WebKitWebView *webView = browser_tab_get_web_view(window->activeTab); 1053 webkit_web_view_try_close(webView); 1068 browserWindowTryClose(window); 1054 1069 return TRUE; 1055 1070 }
Note: See TracChangeset
for help on using the changeset viewer.