Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: chrome/browser/gtk/dialogs_gtk.cc

Issue 159147: Make GTK file dialog box modal for parent window, instead of for the entire... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gtk/browser_window_gtk.cc ('k') | chrome/browser/gtk/info_bubble_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/dialogs_gtk.cc
===================================================================
--- chrome/browser/gtk/dialogs_gtk.cc (revision 21201)
+++ chrome/browser/gtk/dialogs_gtk.cc (working copy)
@@ -26,12 +26,7 @@
static const int kPreviewHeight = 512;
// 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
+// choosing a file or folder. This acts as a modal dialog.
class SelectFileDialogImpl : public SelectFileDialog {
public:
explicit SelectFileDialogImpl(Listener* listener);
@@ -208,7 +203,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.
+ 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);
}
« no previous file with comments | « chrome/browser/gtk/browser_window_gtk.cc ('k') | chrome/browser/gtk/info_bubble_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698