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 7a9d112961e869096df1e61ade01ec25ae9821ba..cec97c76dcb051e9913ed6fe71d09be956a45ec1 100644 |
--- a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc |
+++ b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc |
@@ -2,6 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include <gdk/gdkx.h> |
#include <gtk/gtk.h> |
#include <map> |
#include <set> |
@@ -272,9 +273,9 @@ void SelectFileDialogImplGTK::SelectFileImpl( |
params_map_[dialog] = params; |
- // TODO(erg): Figure out how to fake GTK window-to-parent modality without |
- // having the parent be a real GtkWindow. |
- gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); |
+ // Disable input events handling in the host window to make the dialog modal. |
+ views::X11DesktopHandler::get()->SetModalDialog(GDK_WINDOW_XID( |
+ gtk_widget_get_window(dialog))); |
sadrul
2015/04/21 19:50:01
This makes it modal for all chrome windows. Should
joone
2015/04/22 19:44:33
Yes, dialog should be only modal to a particular c
|
gtk_widget_show_all(dialog); |
@@ -525,6 +526,8 @@ void SelectFileDialogImplGTK::FileDialogDestroyed(GtkWidget* dialog) { |
aura::Window* parent = GetAuraTransientParent(dialog); |
if (!parent) |
return; |
+ |
+ views::X11DesktopHandler::get()->SetModalDialog(None); |
std::set<aura::Window*>::iterator iter = parents_.find(parent); |
if (iter != parents_.end()) { |
(*iter)->RemoveObserver(this); |