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..259a3f68a2e1fd9e6c98832e7bc95faf8acf7ea1 100644 |
--- a/ui/views/widget/desktop_aura/x11_desktop_handler.cc |
+++ b/ui/views/widget/desktop_aura/x11_desktop_handler.cc |
@@ -216,8 +216,13 @@ void X11DesktopHandler::OnActiveWindowChanged(::Window xid, |
if (active_state == ACTIVE) { |
DesktopWindowTreeHostX11* new_host = |
views::DesktopWindowTreeHostX11::GetHostForXID(xid); |
- if (new_host) |
+ if (new_host) { |
new_host->HandleNativeWidgetActivationChanged(true); |
sadrul
2015/07/08 15:02:31
We don't actually want to call this if |new_host|
joone
2015/07/08 17:16:45
Yes, we may not need to call this. I will test it.
|
+ // Set focus to the modal dialog instead of the host window. |
+ if (new_host->GetModalDialog()) |
+ XSetInputFocus(xdisplay_, new_host->GetModalDialog(), |
+ RevertToParent, CurrentTime); |
+ } |
} |
} |