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

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

Issue 1045443002: Make File-Picker modal on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed modal_dialog_xid_ in X11DesktopHandler and fixed others. Created 5 years, 6 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
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 b7ca334936c924ce4cfac5ed073e300c0c6779ae..250b727a53b64737c84cb610791e72a47accfe55 100644
--- a/ui/views/widget/desktop_aura/x11_desktop_handler.cc
+++ b/ui/views/widget/desktop_aura/x11_desktop_handler.cc
@@ -170,6 +170,15 @@ uint32_t X11DesktopHandler::DispatchEvent(const ui::PlatformEvent& event) {
::Window window;
if (ui::GetXIDProperty(x_root_window_, "_NET_ACTIVE_WINDOW", &window) &&
window) {
+ // Set focus to the modal dialog instead of the host window.
+ DesktopWindowTreeHostX11* new_host =
+ views::DesktopWindowTreeHostX11::GetHostForXID(window);
+ if (new_host && new_host->GetModalDialog()) {
+ XSetInputFocus(xdisplay_, new_host->GetModalDialog(),
+ RevertToParent, CurrentTime);
+ break;
+ }
+
OnActiveWindowChanged(window, ACTIVE);
}
}

Powered by Google App Engine
This is Rietveld 408576698