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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |