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

Side by Side Diff: ui/views/widget/desktop_aura/x11_desktop_handler.cc

Issue 173803002: Redesigns the text input focus handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review comments from sky. Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 176
177 void X11DesktopHandler::OnActiveWindowChanged(::Window xid) { 177 void X11DesktopHandler::OnActiveWindowChanged(::Window xid) {
178 if (current_window_ == xid) 178 if (current_window_ == xid)
179 return; 179 return;
180 DesktopWindowTreeHostX11* old_host = 180 DesktopWindowTreeHostX11* old_host =
181 views::DesktopWindowTreeHostX11::GetHostForXID(current_window_); 181 views::DesktopWindowTreeHostX11::GetHostForXID(current_window_);
182 if (old_host) 182 if (old_host)
183 old_host->HandleNativeWidgetActivationChanged(false); 183 old_host->HandleNativeWidgetActivationChanged(false);
184 184
185 // Update the current window ID to effectively change the active widget.
186 current_window_ = xid;
187
185 DesktopWindowTreeHostX11* new_host = 188 DesktopWindowTreeHostX11* new_host =
186 views::DesktopWindowTreeHostX11::GetHostForXID(xid); 189 views::DesktopWindowTreeHostX11::GetHostForXID(xid);
187 if (new_host) 190 if (new_host)
188 new_host->HandleNativeWidgetActivationChanged(true); 191 new_host->HandleNativeWidgetActivationChanged(true);
189
190 current_window_ = xid;
191 } 192 }
192 193
193 } // namespace views 194 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698