| Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
|
| diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
|
| index 95f47b90e9cc1c960c94950c4a7d45806cab3d67..2d52d39a8a37ee6c9cb3fbba758df229342b4c82 100644
|
| --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
|
| +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
|
| @@ -175,6 +175,10 @@ int XI2ModeToXMode(int xi2_mode) {
|
| }
|
| }
|
|
|
| +int IgnoreX11Errors(XDisplay* display, XErrorEvent* error) {
|
| + return 0;
|
| +}
|
| +
|
| } // namespace
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| @@ -800,13 +804,10 @@ void DesktopWindowTreeHostX11::Activate() {
|
| } else {
|
| XRaiseWindow(xdisplay_, xwindow_);
|
| // Directly ask the X server to give focus to the window. Note that the call
|
| - // will raise an X error if the window is not mapped.
|
| + // would have raised an X error if the window is not mapped.
|
| + auto old_error_handler = XSetErrorHandler(IgnoreX11Errors);
|
| XSetInputFocus(xdisplay_, xwindow_, RevertToParent, timestamp);
|
| - // At this point, we know we will receive focus, and some tests depend on a
|
| - // window being IsActive() immediately after an Activate(), so just set this
|
| - // state now.
|
| - has_pointer_focus_ = false;
|
| - has_window_focus_ = true;
|
| + XSetErrorHandler(old_error_handler);
|
| }
|
| AfterActivationStateChanged();
|
| }
|
|
|