OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/widget/desktop_aura/x11_desktop_handler.h" | 5 #include "ui/views/widget/desktop_aura/x11_desktop_handler.h" |
6 | 6 |
7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 | 9 |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
182 } | 182 } |
183 | 183 |
184 void X11DesktopHandler::OnActiveWindowChanged(::Window xid) { | 184 void X11DesktopHandler::OnActiveWindowChanged(::Window xid) { |
185 if (current_window_ == xid) | 185 if (current_window_ == xid) |
186 return; | 186 return; |
187 DesktopWindowTreeHostX11* old_host = | 187 DesktopWindowTreeHostX11* old_host = |
188 views::DesktopWindowTreeHostX11::GetHostForXID(current_window_); | 188 views::DesktopWindowTreeHostX11::GetHostForXID(current_window_); |
189 if (old_host) | 189 if (old_host) |
190 old_host->HandleNativeWidgetActivationChanged(false); | 190 old_host->HandleNativeWidgetActivationChanged(false); |
191 | 191 |
192 // Update the current window ID to effectively change the active widget. | |
193 current_window_ = xid; | |
msw
2014/04/18 19:57:57
Can you explain why this change is needed for this
Yuki
2014/04/22 09:09:02
It's because we have to change the active widget b
| |
194 | |
192 DesktopWindowTreeHostX11* new_host = | 195 DesktopWindowTreeHostX11* new_host = |
193 views::DesktopWindowTreeHostX11::GetHostForXID(xid); | 196 views::DesktopWindowTreeHostX11::GetHostForXID(xid); |
194 if (new_host) | 197 if (new_host) |
195 new_host->HandleNativeWidgetActivationChanged(true); | 198 new_host->HandleNativeWidgetActivationChanged(true); |
196 | |
197 current_window_ = xid; | |
198 } | 199 } |
199 | 200 |
200 } // namespace views | 201 } // namespace views |
OLD | NEW |