| Index: chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc
|
| diff --git a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc
|
| index d37f9be03c1e32e364f41512be8e72cbd2f3e610..5ccff627f91b2272c323b613989a4caa8160a828 100644
|
| --- a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc
|
| +++ b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc
|
| @@ -170,16 +170,18 @@ void SelectFileDialogImplGTK::SelectFileImpl(
|
| params_map_[dialog] = params;
|
|
|
| // Disable input events handling in the host window to make this dialog modal.
|
| - views::DesktopWindowTreeHostX11* host =
|
| - views::DesktopWindowTreeHostX11::GetHostForXID(
|
| - owning_window->GetHost()->GetAcceleratedWidget());
|
| - std::unique_ptr<base::Closure> callback = host->DisableEventListening(
|
| - GDK_WINDOW_XID(gtk_widget_get_window(dialog)));
|
| - // OnFilePickerDestroy() is called when |dialog| destroyed, which allows to
|
| - // invoke the callback function to re-enable events on the owning window.
|
| - g_object_set_data_full(G_OBJECT(dialog), "callback", callback.release(),
|
| - reinterpret_cast<GDestroyNotify>(OnFilePickerDestroy));
|
| - gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
|
| + aura::WindowTreeHost* host = owning_window->GetHost();
|
| + if (host) {
|
| + std::unique_ptr<base::Closure> callback =
|
| + views::DesktopWindowTreeHostX11::GetHostForXID(
|
| + host->GetAcceleratedWidget())->DisableEventListening(
|
| + GDK_WINDOW_XID(gtk_widget_get_window(dialog)));
|
| + // OnFilePickerDestroy() is called when |dialog| destroyed, which allows to
|
| + // invoke the callback function to re-enable events on the owning window.
|
| + g_object_set_data_full(G_OBJECT(dialog), "callback", callback.release(),
|
| + reinterpret_cast<GDestroyNotify>(OnFilePickerDestroy));
|
| + gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
|
| + }
|
|
|
| gtk_widget_show_all(dialog);
|
|
|
|
|