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