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/aura/window_tree_host_x11.h" | 5 #include "ui/aura/window_tree_host_x11.h" |
6 | 6 |
7 #include <strings.h> | 7 #include <strings.h> |
8 #include <X11/cursorfont.h> | 8 #include <X11/cursorfont.h> |
9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
10 #include <X11/extensions/Xrandr.h> | 10 #include <X11/extensions/Xrandr.h> |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 protocols[1] = atom_cache_.GetAtom("_NET_WM_PING"); | 274 protocols[1] = atom_cache_.GetAtom("_NET_WM_PING"); |
275 XSetWMProtocols(xdisplay_, xwindow_, protocols, 2); | 275 XSetWMProtocols(xdisplay_, xwindow_, protocols, 2); |
276 | 276 |
277 // We need a WM_CLIENT_MACHINE and WM_LOCALE_NAME value so we integrate with | 277 // We need a WM_CLIENT_MACHINE and WM_LOCALE_NAME value so we integrate with |
278 // the desktop environment. | 278 // the desktop environment. |
279 XSetWMProperties(xdisplay_, xwindow_, NULL, NULL, NULL, 0, NULL, NULL, NULL); | 279 XSetWMProperties(xdisplay_, xwindow_, NULL, NULL, NULL, 0, NULL, NULL, NULL); |
280 | 280 |
281 // Likewise, the X server needs to know this window's pid so it knows which | 281 // Likewise, the X server needs to know this window's pid so it knows which |
282 // program to kill if the window hangs. | 282 // program to kill if the window hangs. |
283 // XChangeProperty() expects "pid" to be long. | 283 // XChangeProperty() expects "pid" to be long. |
284 COMPILE_ASSERT(sizeof(long) >= sizeof(pid_t), pid_t_bigger_than_long); | 284 static_assert(sizeof(long) >= sizeof(pid_t), |
| 285 "pid_t should not be larger than long"); |
285 long pid = getpid(); | 286 long pid = getpid(); |
286 XChangeProperty(xdisplay_, | 287 XChangeProperty(xdisplay_, |
287 xwindow_, | 288 xwindow_, |
288 atom_cache_.GetAtom("_NET_WM_PID"), | 289 atom_cache_.GetAtom("_NET_WM_PID"), |
289 XA_CARDINAL, | 290 XA_CARDINAL, |
290 32, | 291 32, |
291 PropModeReplace, | 292 PropModeReplace, |
292 reinterpret_cast<unsigned char*>(&pid), 1); | 293 reinterpret_cast<unsigned char*>(&pid), 1); |
293 | 294 |
294 // Allow subclasses to create and cache additional atoms. | 295 // Allow subclasses to create and cache additional atoms. |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 } | 692 } |
692 | 693 |
693 namespace test { | 694 namespace test { |
694 | 695 |
695 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { | 696 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { |
696 default_override_redirect = override_redirect; | 697 default_override_redirect = override_redirect; |
697 } | 698 } |
698 | 699 |
699 } // namespace test | 700 } // namespace test |
700 } // namespace aura | 701 } // namespace aura |
OLD | NEW |