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

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

Issue 137533006: Call XSetInputFocus after XRaiseWindow when activating. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: call only if the window is viewable Created 6 years, 11 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
« no previous file with comments | « no previous file | 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 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);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698