| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 (event->type == PropertyNotify && | 87 (event->type == PropertyNotify && |
| 88 event->xproperty.window == x_root_window_); | 88 event->xproperty.window == x_root_window_); |
| 89 } | 89 } |
| 90 | 90 |
| 91 uint32_t X11DesktopHandler::DispatchEvent(const ui::PlatformEvent& event) { | 91 uint32_t X11DesktopHandler::DispatchEvent(const ui::PlatformEvent& event) { |
| 92 switch (event->type) { | 92 switch (event->type) { |
| 93 case PropertyNotify: { | 93 case PropertyNotify: { |
| 94 if (event->xproperty.atom == | 94 if (event->xproperty.atom == |
| 95 atom_cache_.GetAtom("_NET_CURRENT_DESKTOP")) { | 95 atom_cache_.GetAtom("_NET_CURRENT_DESKTOP")) { |
| 96 if (UpdateWorkspace()) { | 96 if (UpdateWorkspace()) { |
| 97 FOR_EACH_OBSERVER(views::X11DesktopHandlerObserver, observers_, | 97 for (auto& observer : observers_) |
| 98 OnWorkspaceChanged(workspace_)); | 98 observer.OnWorkspaceChanged(workspace_); |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 break; | 101 break; |
| 102 } | 102 } |
| 103 case CreateNotify: | 103 case CreateNotify: |
| 104 OnWindowCreatedOrDestroyed(event->type, event->xcreatewindow.window); | 104 OnWindowCreatedOrDestroyed(event->type, event->xcreatewindow.window); |
| 105 break; | 105 break; |
| 106 case DestroyNotify: | 106 case DestroyNotify: |
| 107 OnWindowCreatedOrDestroyed(event->type, event->xdestroywindow.window); | 107 OnWindowCreatedOrDestroyed(event->type, event->xdestroywindow.window); |
| 108 break; | 108 break; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 134 // The window might be destroyed if the message pump did not get a chance to | 134 // The window might be destroyed if the message pump did not get a chance to |
| 135 // run but we can safely ignore the X error. | 135 // run but we can safely ignore the X error. |
| 136 gfx::X11ErrorTracker error_tracker; | 136 gfx::X11ErrorTracker error_tracker; |
| 137 ui::XMenuList::GetInstance()->MaybeRegisterMenu(window); | 137 ui::XMenuList::GetInstance()->MaybeRegisterMenu(window); |
| 138 } else { | 138 } else { |
| 139 ui::XMenuList::GetInstance()->MaybeUnregisterMenu(window); | 139 ui::XMenuList::GetInstance()->MaybeUnregisterMenu(window); |
| 140 } | 140 } |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace views | 143 } // namespace views |
| OLD | NEW |