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

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

Issue 1027883003: Only call OnActiveWindowChanged() for NotifyNormal FocusIn/FocusOut events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // There is nothing else that we can do. Pretend that we have been 129 // There is nothing else that we can do. Pretend that we have been
130 // deactivated and ignore keyboard input in DesktopWindowTreeHostX11. 130 // deactivated and ignore keyboard input in DesktopWindowTreeHostX11.
131 OnActiveWindowChanged(window, NOT_ACTIVE); 131 OnActiveWindowChanged(window, NOT_ACTIVE);
132 } 132 }
133 133
134 bool X11DesktopHandler::IsActiveWindow(::Window window) const { 134 bool X11DesktopHandler::IsActiveWindow(::Window window) const {
135 return window == current_window_ && current_window_active_state_ == ACTIVE; 135 return window == current_window_ && current_window_active_state_ == ACTIVE;
136 } 136 }
137 137
138 void X11DesktopHandler::ProcessXEvent(XEvent* event) { 138 void X11DesktopHandler::ProcessXEvent(XEvent* event) {
139 // Ignore focus events in modes other than NotifyNormal (i.e. NotifyGrab), as
140 // they are always sent when the pointer is over our window, even if the
141 // input focus is in a different window.
142 if (event->xfocus.mode != NotifyNormal)
143 return;
144
139 switch (event->type) { 145 switch (event->type) {
140 case FocusIn: 146 case FocusIn:
141 if (current_window_ != event->xfocus.window) 147 if (current_window_ != event->xfocus.window)
142 OnActiveWindowChanged(event->xfocus.window, ACTIVE); 148 OnActiveWindowChanged(event->xfocus.window, ACTIVE);
143 break; 149 break;
144 case FocusOut: 150 case FocusOut:
145 if (current_window_ == event->xfocus.window) 151 if (current_window_ == event->xfocus.window)
146 OnActiveWindowChanged(None, NOT_ACTIVE); 152 OnActiveWindowChanged(None, NOT_ACTIVE);
147 break; 153 break;
148 default: 154 default:
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 ui::XMenuList::GetInstance()->MaybeUnregisterMenu(window); 241 ui::XMenuList::GetInstance()->MaybeUnregisterMenu(window);
236 } 242 }
237 243
238 if (event_type == DestroyNotify) { 244 if (event_type == DestroyNotify) {
239 // Notify the XForeignWindowManager that |window| has been destroyed. 245 // Notify the XForeignWindowManager that |window| has been destroyed.
240 ui::XForeignWindowManager::GetInstance()->OnWindowDestroyed(window); 246 ui::XForeignWindowManager::GetInstance()->OnWindowDestroyed(window);
241 } 247 }
242 } 248 }
243 249
244 } // namespace views 250 } // namespace views
OLDNEW
« 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