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

Unified Diff: chrome/browser/ui/libgtk2ui/print_dialog_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 | « no previous file | chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/libgtk2ui/print_dialog_gtk2.cc
diff --git a/chrome/browser/ui/libgtk2ui/print_dialog_gtk2.cc b/chrome/browser/ui/libgtk2ui/print_dialog_gtk2.cc
index 958a9c88a8f1a903b8ee676a4aad3e5092b86368..8f1cdb50ffc83d1b72af38c9bbe6cf98dc9990da 100644
--- a/chrome/browser/ui/libgtk2ui/print_dialog_gtk2.cc
+++ b/chrome/browser/ui/libgtk2ui/print_dialog_gtk2.cc
@@ -25,6 +25,7 @@
#include "printing/print_job_constants.h"
#include "printing/print_settings.h"
#include "ui/aura/window.h"
+#include "ui/views/widget/desktop_aura/x11_desktop_handler.h"
using content::BrowserThread;
using printing::PageRanges;
@@ -353,6 +354,11 @@ void PrintDialogGtk2::ShowDialog(
gtk_settings_);
g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this);
gtk_widget_show(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 PrintDialogGtk2::PrintDocument(const printing::Metafile* metafile,
« no previous file with comments | « no previous file | chrome/browser/ui/libgtk2ui/select_file_dialog_impl_gtk2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698