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

Unified Diff: chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc

Issue 543093002: Fix focus on popup GTK dialogs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/ui/libgtk2ui/print_dialog_gtk2.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c4ced375c6e3a89367417f9ae54bdf17976828ce..24daaae53f4ad9d0954a24d61ea29c5921a568ea 100644
--- a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc
+++ b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc
@@ -25,6 +25,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/shell_dialogs/select_file_dialog.h"
#include "ui/strings/grit/ui_strings.h"
+#include "ui/views/widget/desktop_aura/x11_desktop_handler.h"
namespace {
@@ -277,6 +278,11 @@ void SelectFileDialogImplGTK::SelectFileImpl(
gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
gtk_widget_show_all(dialog);
+
+ // We need to call gtk_window_present after making the widgets visible to make
+ // sure window gets correctly raised and gets focus.
+ int time = views::X11DesktopHandler::get()->wm_user_time_ms();
+ gtk_window_present_with_time(GTK_WINDOW(dialog), time);
}
void SelectFileDialogImplGTK::AddFilters(GtkFileChooser* chooser) {
« no previous file with comments | « chrome/browser/ui/libgtk2ui/print_dialog_gtk2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698