Chromium Code Reviews| 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 3a14e04c076cebcbace6271db290e940ef144ef7..d99a501b2840eb18197113e7bfa56ce8144da908 100644 |
| --- a/ui/views/widget/desktop_aura/x11_desktop_handler.cc |
| +++ b/ui/views/widget/desktop_aura/x11_desktop_handler.cc |
| @@ -94,6 +94,15 @@ void X11DesktopHandler::ActivateWindow(::Window window) { |
| &xclient); |
| } else { |
| XRaiseWindow(xdisplay_, window); |
| + |
| + // XRaiseWindow will not give input focus to the window. We now need to ask |
| + // the X server to do that. However, if the window is not viewable this will |
| + // produce an error so we have to check that before making the call. |
| + XWindowAttributes attributes; |
| + XGetWindowAttributes(xdisplay_, window, &attributes); |
| + if (attributes.map_state == IsViewable) |
|
sadrul
2014/01/15 19:23:50
Is this only ever called from DesktopWindowTreeHos
mlamouri (slow - plz ping)
2014/01/15 23:15:18
The assertion goes away but the test fail with tha
sadrul
2014/01/15 23:18:53
Shouldn't we return early from DesktopWindowTreeHo
mlamouri (slow - plz ping)
2014/01/15 23:27:50
I think that would be reasonable but it would brea
sadrul
2014/01/15 23:31:35
The test can be fixed by making sure the widgets c
|
| + XSetInputFocus(xdisplay_, window, RevertToParent, CurrentTime); |
| + |
| OnActiveWindowChanged(window); |
| } |
| } |