From 4524c4ef3440e002b883e1734c32a04481881234 Mon Sep 17 00:00:00 2001 From: "atwilson@chromium.org" Date: Mon, 19 Jul 2010 20:26:25 +0000 Subject: Only auto-close dialogs when last browser closes. Update GTK version of BrowserList::AllBrowsersClosed() to only close widgets that pass the GTK_IS_DIALOG() filter to avoid prematurely closing status icons. BUG=49391 TEST=none (unit test is part of a pending CL) Review URL: http://codereview.chromium.org/3040006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52945 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/browser_list_gtk.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'chrome/browser/browser_list_gtk.cc') diff --git a/chrome/browser/browser_list_gtk.cc b/chrome/browser/browser_list_gtk.cc index cf74096..8633121 100644 --- a/chrome/browser/browser_list_gtk.cc +++ b/chrome/browser/browser_list_gtk.cc @@ -16,7 +16,10 @@ void BrowserList::AllBrowsersClosed() { // We filter by visible widgets because there are toplevel windows that if // we try to destroy, we crash. For example, trying to destroy the tooltip // window or the toplevel associated with drop down windows crashes. - if (GTK_WIDGET_VISIBLE(GTK_WIDGET(window))) + // We further filter to only close dialogs, as blindly closing all windows + // causes problems with things like status icons. + if (GTK_WIDGET_VISIBLE(GTK_WIDGET(window)) && + (GTK_IS_DIALOG(GTK_WIDGET(window)))) gtk_widget_destroy(GTK_WIDGET(window)); } g_list_foreach(window_list, (GFunc)g_object_unref, NULL); -- cgit v1.1