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" |
11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 #include "ui/aura/env.h" | 12 #include "ui/aura/env.h" |
13 #include "ui/aura/window_event_dispatcher.h" | 13 #include "ui/aura/window_event_dispatcher.h" |
| 14 #include "ui/base/x/x11_foreign_window_manager.h" |
14 #include "ui/base/x/x11_menu_list.h" | 15 #include "ui/base/x/x11_menu_list.h" |
15 #include "ui/base/x/x11_util.h" | 16 #include "ui/base/x/x11_util.h" |
16 #include "ui/events/platform/platform_event_source.h" | 17 #include "ui/events/platform/platform_event_source.h" |
17 #include "ui/gfx/x/x11_error_tracker.h" | 18 #include "ui/gfx/x/x11_error_tracker.h" |
18 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" | 19 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" |
19 | 20 |
20 namespace { | 21 namespace { |
21 | 22 |
22 const char* const kAtomsToCache[] = { | 23 const char* const kAtomsToCache[] = { |
23 "_NET_CURRENT_DESKTOP", | 24 "_NET_CURRENT_DESKTOP", |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // coordinates and stacking order to eliminate repeated calls to the X server | 133 // coordinates and stacking order to eliminate repeated calls to the X server |
133 // during mouse movement, drag and shaping events. | 134 // during mouse movement, drag and shaping events. |
134 if (event_type == CreateNotify) { | 135 if (event_type == CreateNotify) { |
135 // The window might be destroyed if the message pump did not get a chance to | 136 // The window might be destroyed if the message pump did not get a chance to |
136 // run but we can safely ignore the X error. | 137 // run but we can safely ignore the X error. |
137 gfx::X11ErrorTracker error_tracker; | 138 gfx::X11ErrorTracker error_tracker; |
138 ui::XMenuList::GetInstance()->MaybeRegisterMenu(window); | 139 ui::XMenuList::GetInstance()->MaybeRegisterMenu(window); |
139 } else { | 140 } else { |
140 ui::XMenuList::GetInstance()->MaybeUnregisterMenu(window); | 141 ui::XMenuList::GetInstance()->MaybeUnregisterMenu(window); |
141 } | 142 } |
| 143 |
| 144 if (event_type == DestroyNotify) { |
| 145 // Notify the XForeignWindowManager that |window| has been destroyed. |
| 146 ui::XForeignWindowManager::GetInstance()->OnWindowDestroyed(window); |
| 147 } |
142 } | 148 } |
143 | 149 |
144 } // namespace views | 150 } // namespace views |
OLD | NEW |