| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 NOTREACHED(); | 149 NOTREACHED(); |
| 150 } | 150 } |
| 151 } | 151 } |
| 152 | 152 |
| 153 bool X11DesktopHandler::CanDispatchEvent(const ui::PlatformEvent& event) { | 153 bool X11DesktopHandler::CanDispatchEvent(const ui::PlatformEvent& event) { |
| 154 return event->type == CreateNotify || event->type == DestroyNotify || | 154 return event->type == CreateNotify || event->type == DestroyNotify || |
| 155 (event->type == PropertyNotify && | 155 (event->type == PropertyNotify && |
| 156 event->xproperty.window == x_root_window_); | 156 event->xproperty.window == x_root_window_); |
| 157 } | 157 } |
| 158 | 158 |
| 159 uint32_t X11DesktopHandler::DispatchEvent(const ui::PlatformEvent& event) { | 159 ui::PostDispatchAction X11DesktopHandler::DispatchEvent( |
| 160 const ui::PlatformEvent& event) { |
| 160 switch (event->type) { | 161 switch (event->type) { |
| 161 case PropertyNotify: { | 162 case PropertyNotify: { |
| 162 // Check for a change to the active window. | 163 // Check for a change to the active window. |
| 163 CHECK_EQ(x_root_window_, event->xproperty.window); | 164 CHECK_EQ(x_root_window_, event->xproperty.window); |
| 164 ::Atom active_window_atom = atom_cache_.GetAtom("_NET_ACTIVE_WINDOW"); | 165 ::Atom active_window_atom = atom_cache_.GetAtom("_NET_ACTIVE_WINDOW"); |
| 165 if (event->xproperty.atom == active_window_atom) { | 166 if (event->xproperty.atom == active_window_atom) { |
| 166 ::Window window; | 167 ::Window window; |
| 167 if (ui::GetXIDProperty(x_root_window_, "_NET_ACTIVE_WINDOW", &window) && | 168 if (ui::GetXIDProperty(x_root_window_, "_NET_ACTIVE_WINDOW", &window) && |
| 168 window) { | 169 window) { |
| 169 OnActiveWindowChanged(window, ACTIVE); | 170 OnActiveWindowChanged(window, ACTIVE); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 ui::XMenuList::GetInstance()->MaybeUnregisterMenu(window); | 236 ui::XMenuList::GetInstance()->MaybeUnregisterMenu(window); |
| 236 } | 237 } |
| 237 | 238 |
| 238 if (event_type == DestroyNotify) { | 239 if (event_type == DestroyNotify) { |
| 239 // Notify the XForeignWindowManager that |window| has been destroyed. | 240 // Notify the XForeignWindowManager that |window| has been destroyed. |
| 240 ui::XForeignWindowManager::GetInstance()->OnWindowDestroyed(window); | 241 ui::XForeignWindowManager::GetInstance()->OnWindowDestroyed(window); |
| 241 } | 242 } |
| 242 } | 243 } |
| 243 | 244 |
| 244 } // namespace views | 245 } // namespace views |
| OLD | NEW |