From be28ffa02889a842f67fb354a7c289d8ab4db2ab Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 13 Mar 2014 13:03:38 +0800 Subject: [PATCH] gtk: File dialog should be modal window. --- browser/ui/file_dialog_gtk.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/browser/ui/file_dialog_gtk.cc b/browser/ui/file_dialog_gtk.cc index 5ffe2d6504e3..a9f3d32f7507 100644 --- a/browser/ui/file_dialog_gtk.cc +++ b/browser/ui/file_dialog_gtk.cc @@ -27,6 +27,12 @@ class FileChooserDialog { GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL); + + // 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(window), + GTK_WINDOW(dialog_)); + gtk_window_set_modal(GTK_WINDOW(dialog_), TRUE); } virtual ~FileChooserDialog() {