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..62eb016615c59651dd86dfe1001e4887999c9bc7 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); |
sadrul
2015/07/14 08:13:01
Use {} for both cases.
joone
2015/07/14 22:35:39
Done.
|
+ |
joone
2015/07/08 17:54:46
We don't call new_host->HandleNativeWidgetActivati
|
+ } |
} |
} |