| 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/desktop_window_tree_host_x11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" |
| 6 | 6 |
| 7 #include <X11/extensions/shape.h> | 7 #include <X11/extensions/shape.h> |
| 8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
| 9 #include <X11/Xatom.h> | 9 #include <X11/Xatom.h> |
| 10 #include <X11/Xregion.h> | 10 #include <X11/Xregion.h> |
| (...skipping 2152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2163 } | 2163 } |
| 2164 | 2164 |
| 2165 // If we coalesced an event we need to free its cookie. | 2165 // If we coalesced an event we need to free its cookie. |
| 2166 if (num_coalesced > 0) | 2166 if (num_coalesced > 0) |
| 2167 XFreeEventData(xev->xgeneric.display, &last_event.xcookie); | 2167 XFreeEventData(xev->xgeneric.display, &last_event.xcookie); |
| 2168 break; | 2168 break; |
| 2169 } | 2169 } |
| 2170 case MapNotify: { | 2170 case MapNotify: { |
| 2171 window_mapped_ = true; | 2171 window_mapped_ = true; |
| 2172 | 2172 |
| 2173 FOR_EACH_OBSERVER(DesktopWindowTreeHostObserverX11, | 2173 for (auto& observer : observer_list_) |
| 2174 observer_list_, | 2174 observer.OnWindowMapped(xwindow_); |
| 2175 OnWindowMapped(xwindow_)); | |
| 2176 | 2175 |
| 2177 UpdateMinAndMaxSize(); | 2176 UpdateMinAndMaxSize(); |
| 2178 | 2177 |
| 2179 // Some WMs only respect maximize hints after the window has been mapped. | 2178 // Some WMs only respect maximize hints after the window has been mapped. |
| 2180 // Check whether we need to re-do a maximization. | 2179 // Check whether we need to re-do a maximization. |
| 2181 if (should_maximize_after_map_) { | 2180 if (should_maximize_after_map_) { |
| 2182 Maximize(); | 2181 Maximize(); |
| 2183 should_maximize_after_map_ = false; | 2182 should_maximize_after_map_ = false; |
| 2184 } | 2183 } |
| 2185 | 2184 |
| 2186 break; | 2185 break; |
| 2187 } | 2186 } |
| 2188 case UnmapNotify: { | 2187 case UnmapNotify: { |
| 2189 window_mapped_ = false; | 2188 window_mapped_ = false; |
| 2190 wait_for_unmap_ = false; | 2189 wait_for_unmap_ = false; |
| 2191 has_pointer_ = false; | 2190 has_pointer_ = false; |
| 2192 has_pointer_grab_ = false; | 2191 has_pointer_grab_ = false; |
| 2193 has_pointer_focus_ = false; | 2192 has_pointer_focus_ = false; |
| 2194 has_window_focus_ = false; | 2193 has_window_focus_ = false; |
| 2195 FOR_EACH_OBSERVER(DesktopWindowTreeHostObserverX11, | 2194 for (auto& observer : observer_list_) |
| 2196 observer_list_, | 2195 observer.OnWindowUnmapped(xwindow_); |
| 2197 OnWindowUnmapped(xwindow_)); | |
| 2198 break; | 2196 break; |
| 2199 } | 2197 } |
| 2200 case ClientMessage: { | 2198 case ClientMessage: { |
| 2201 Atom message_type = xev->xclient.message_type; | 2199 Atom message_type = xev->xclient.message_type; |
| 2202 if (message_type == atom_cache_.GetAtom("WM_PROTOCOLS")) { | 2200 if (message_type == atom_cache_.GetAtom("WM_PROTOCOLS")) { |
| 2203 Atom protocol = static_cast<Atom>(xev->xclient.data.l[0]); | 2201 Atom protocol = static_cast<Atom>(xev->xclient.data.l[0]); |
| 2204 if (protocol == atom_cache_.GetAtom("WM_DELETE_WINDOW")) { | 2202 if (protocol == atom_cache_.GetAtom("WM_DELETE_WINDOW")) { |
| 2205 // We have received a close message from the window manager. | 2203 // We have received a close message from the window manager. |
| 2206 OnHostCloseRequested(); | 2204 OnHostCloseRequested(); |
| 2207 } else if (protocol == atom_cache_.GetAtom("_NET_WM_PING")) { | 2205 } else if (protocol == atom_cache_.GetAtom("_NET_WM_PING")) { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2369 if (linux_ui) { | 2367 if (linux_ui) { |
| 2370 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); | 2368 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); |
| 2371 if (native_theme) | 2369 if (native_theme) |
| 2372 return native_theme; | 2370 return native_theme; |
| 2373 } | 2371 } |
| 2374 | 2372 |
| 2375 return ui::NativeThemeAura::instance(); | 2373 return ui::NativeThemeAura::instance(); |
| 2376 } | 2374 } |
| 2377 | 2375 |
| 2378 } // namespace views | 2376 } // namespace views |
| OLD | NEW |