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

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

Issue 549713003: Handle _NET_ACTIVE_WINDOW or FocusIn & FocusOut, not both. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 OnActiveWindowChanged(window, NOT_ACTIVE); 127 OnActiveWindowChanged(window, NOT_ACTIVE);
128 } 128 }
129 129
130 bool X11DesktopHandler::IsActiveWindow(::Window window) const { 130 bool X11DesktopHandler::IsActiveWindow(::Window window) const {
131 return window == current_window_ && current_window_active_state_ == ACTIVE; 131 return window == current_window_ && current_window_active_state_ == ACTIVE;
132 } 132 }
133 133
134 void X11DesktopHandler::ProcessXEvent(XEvent* event) { 134 void X11DesktopHandler::ProcessXEvent(XEvent* event) {
135 switch (event->type) { 135 switch (event->type) {
136 case FocusIn: 136 case FocusIn:
137 if (current_window_ != event->xfocus.window) 137 if (!wm_supports_active_window_ &&
138 current_window_ != event->xfocus.window)
138 OnActiveWindowChanged(event->xfocus.window, ACTIVE); 139 OnActiveWindowChanged(event->xfocus.window, ACTIVE);
139 break; 140 break;
140 case FocusOut: 141 case FocusOut:
141 if (current_window_ == event->xfocus.window) 142 if (!wm_supports_active_window_ &&
143 current_window_ == event->xfocus.window)
142 OnActiveWindowChanged(None, NOT_ACTIVE); 144 OnActiveWindowChanged(None, NOT_ACTIVE);
143 break; 145 break;
144 default: 146 default:
145 NOTREACHED(); 147 NOTREACHED();
146 } 148 }
147 } 149 }
148 150
149 bool X11DesktopHandler::CanDispatchEvent(const ui::PlatformEvent& event) { 151 bool X11DesktopHandler::CanDispatchEvent(const ui::PlatformEvent& event) {
150 return event->type == CreateNotify || event->type == DestroyNotify || 152 return event->type == CreateNotify || event->type == DestroyNotify ||
151 (event->type == PropertyNotify && 153 (event->type == PropertyNotify &&
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 ui::XMenuList::GetInstance()->MaybeUnregisterMenu(window); 233 ui::XMenuList::GetInstance()->MaybeUnregisterMenu(window);
232 } 234 }
233 235
234 if (event_type == DestroyNotify) { 236 if (event_type == DestroyNotify) {
235 // Notify the XForeignWindowManager that |window| has been destroyed. 237 // Notify the XForeignWindowManager that |window| has been destroyed.
236 ui::XForeignWindowManager::GetInstance()->OnWindowDestroyed(window); 238 ui::XForeignWindowManager::GetInstance()->OnWindowDestroyed(window);
237 } 239 }
238 } 240 }
239 241
240 } // namespace views 242 } // 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