Chromium Code Reviews| Index: chrome/browser/gtk/dialogs_gtk.cc |
| =================================================================== |
| --- chrome/browser/gtk/dialogs_gtk.cc (revision 21116) |
| +++ chrome/browser/gtk/dialogs_gtk.cc (working copy) |
| @@ -27,11 +27,7 @@ |
| // Implementation of SelectFileDialog that shows a Gtk common dialog for |
| // choosing a file or folder. |
| -// This acts as a modal dialog. Ideally we want to only act modally for the |
| -// parent window and allow other toplevel chrome windows to still function while |
| -// the dialog is showing, but we need the GtkWindowGroup or something similar to |
| -// get that, and that API is only available in more recent versions of GTK. |
| -// TODO(port): fix modality: crbug.com/8727 |
| +// This acts as a modal dialog. |
| class SelectFileDialogImpl : public SelectFileDialog { |
| public: |
| explicit SelectFileDialogImpl(Listener* listener); |
| @@ -208,7 +204,13 @@ |
| gtk_file_chooser_set_preview_widget(GTK_FILE_CHOOSER(dialog), preview_); |
| params_map_[dialog] = params; |
| + |
| + // Set window-to-parent modality by adding the dialog to the same window |
| + // group as the parent, and calling gtk_grab_add(...) |
|
Evan Martin
2009/07/20 22:49:17
This comment is no longer correct.
|
| + gtk_window_group_add_window(gtk_window_get_group(owning_window), |
| + GTK_WINDOW(dialog)); |
| gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); |
| + |
| gtk_widget_show_all(dialog); |
| } |