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

Unified Diff: ui/views/widget/desktop_aura/x11_desktop_handler.cc

Issue 1233913009: Make File-Picker modal on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove the test infrastructure and rebase on master Created 5 years, 1 month 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 | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/x11_desktop_handler.cc
diff --git a/ui/views/widget/desktop_aura/x11_desktop_handler.cc b/ui/views/widget/desktop_aura/x11_desktop_handler.cc
index 5ab84f9928e6d0f6305ee1642d3c4bf18c9bdfb5..9b20295cc62fa621bbba890d0640e826f090c710 100644
--- a/ui/views/widget/desktop_aura/x11_desktop_handler.cc
+++ b/ui/views/widget/desktop_aura/x11_desktop_handler.cc
@@ -228,8 +228,15 @@ void X11DesktopHandler::OnActiveWindowChanged(::Window xid,
if (active_state == ACTIVE) {
DesktopWindowTreeHostX11* new_host =
views::DesktopWindowTreeHostX11::GetHostForXID(xid);
- if (new_host)
- new_host->HandleNativeWidgetActivationChanged(true);
+ if (new_host) {
+ // Set focus to the modal dialog instead of the host window.
+ if (new_host->GetModalDialog()) {
+ XSetInputFocus(xdisplay_, new_host->GetModalDialog(),
+ RevertToParent, CurrentTime);
+ } else {
+ new_host->HandleNativeWidgetActivationChanged(true);
+ }
+ }
}
}
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698