| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // should listen for activation events and anything else that GTK+ listens | 153 // should listen for activation events and anything else that GTK+ listens |
| 154 // for, and do something useful. | 154 // for, and do something useful. |
| 155 ::Atom protocols[2]; | 155 ::Atom protocols[2]; |
| 156 protocols[0] = atom_cache_.GetAtom("WM_DELETE_WINDOW"); | 156 protocols[0] = atom_cache_.GetAtom("WM_DELETE_WINDOW"); |
| 157 protocols[1] = atom_cache_.GetAtom("_NET_WM_PING"); | 157 protocols[1] = atom_cache_.GetAtom("_NET_WM_PING"); |
| 158 XSetWMProtocols(xdisplay_, xwindow_, protocols, 2); | 158 XSetWMProtocols(xdisplay_, xwindow_, protocols, 2); |
| 159 | 159 |
| 160 // We need a WM_CLIENT_MACHINE and WM_LOCALE_NAME value so we integrate with | 160 // We need a WM_CLIENT_MACHINE and WM_LOCALE_NAME value so we integrate with |
| 161 // the desktop environment. | 161 // the desktop environment. |
| 162 XSetWMProperties(xdisplay_, xwindow_, NULL, NULL, NULL, 0, NULL, NULL, NULL); | 162 XSetWMProperties(xdisplay_, xwindow_, NULL, NULL, NULL, 0, NULL, NULL, NULL); |
| 163 ui::SetWindowClassHint(xdisplay_, xwindow_, "chromiumos", "ChromiumOS"); |
| 163 | 164 |
| 164 // Likewise, the X server needs to know this window's pid so it knows which | 165 // Likewise, the X server needs to know this window's pid so it knows which |
| 165 // program to kill if the window hangs. | 166 // program to kill if the window hangs. |
| 166 // XChangeProperty() expects "pid" to be long. | 167 // XChangeProperty() expects "pid" to be long. |
| 167 static_assert(sizeof(long) >= sizeof(pid_t), | 168 static_assert(sizeof(long) >= sizeof(pid_t), |
| 168 "pid_t should not be larger than long"); | 169 "pid_t should not be larger than long"); |
| 169 long pid = getpid(); | 170 long pid = getpid(); |
| 170 XChangeProperty(xdisplay_, | 171 XChangeProperty(xdisplay_, |
| 171 xwindow_, | 172 xwindow_, |
| 172 atom_cache_.GetAtom("_NET_WM_PID"), | 173 atom_cache_.GetAtom("_NET_WM_PID"), |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 } | 575 } |
| 575 | 576 |
| 576 namespace test { | 577 namespace test { |
| 577 | 578 |
| 578 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { | 579 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { |
| 579 default_override_redirect = override_redirect; | 580 default_override_redirect = override_redirect; |
| 580 } | 581 } |
| 581 | 582 |
| 582 } // namespace test | 583 } // namespace test |
| 583 } // namespace aura | 584 } // namespace aura |
| OLD | NEW |