| 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 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1095 protocols[1] = atom_cache_.GetAtom("_NET_WM_PING"); | 1095 protocols[1] = atom_cache_.GetAtom("_NET_WM_PING"); |
| 1096 XSetWMProtocols(xdisplay_, xwindow_, protocols, 2); | 1096 XSetWMProtocols(xdisplay_, xwindow_, protocols, 2); |
| 1097 | 1097 |
| 1098 // We need a WM_CLIENT_MACHINE and WM_LOCALE_NAME value so we integrate with | 1098 // We need a WM_CLIENT_MACHINE and WM_LOCALE_NAME value so we integrate with |
| 1099 // the desktop environment. | 1099 // the desktop environment. |
| 1100 XSetWMProperties(xdisplay_, xwindow_, NULL, NULL, NULL, 0, NULL, NULL, NULL); | 1100 XSetWMProperties(xdisplay_, xwindow_, NULL, NULL, NULL, 0, NULL, NULL, NULL); |
| 1101 | 1101 |
| 1102 // Likewise, the X server needs to know this window's pid so it knows which | 1102 // Likewise, the X server needs to know this window's pid so it knows which |
| 1103 // program to kill if the window hangs. | 1103 // program to kill if the window hangs. |
| 1104 // XChangeProperty() expects "pid" to be long. | 1104 // XChangeProperty() expects "pid" to be long. |
| 1105 COMPILE_ASSERT(sizeof(long) >= sizeof(pid_t), pid_t_bigger_than_long); | 1105 static_assert(sizeof(long) >= sizeof(pid_t), |
| 1106 "pid_t should not be larger than long"); |
| 1106 long pid = getpid(); | 1107 long pid = getpid(); |
| 1107 XChangeProperty(xdisplay_, | 1108 XChangeProperty(xdisplay_, |
| 1108 xwindow_, | 1109 xwindow_, |
| 1109 atom_cache_.GetAtom("_NET_WM_PID"), | 1110 atom_cache_.GetAtom("_NET_WM_PID"), |
| 1110 XA_CARDINAL, | 1111 XA_CARDINAL, |
| 1111 32, | 1112 32, |
| 1112 PropModeReplace, | 1113 PropModeReplace, |
| 1113 reinterpret_cast<unsigned char*>(&pid), 1); | 1114 reinterpret_cast<unsigned char*>(&pid), 1); |
| 1114 | 1115 |
| 1115 XChangeProperty(xdisplay_, | 1116 XChangeProperty(xdisplay_, |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1929 if (linux_ui) { | 1930 if (linux_ui) { |
| 1930 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); | 1931 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); |
| 1931 if (native_theme) | 1932 if (native_theme) |
| 1932 return native_theme; | 1933 return native_theme; |
| 1933 } | 1934 } |
| 1934 | 1935 |
| 1935 return ui::NativeTheme::instance(); | 1936 return ui::NativeTheme::instance(); |
| 1936 } | 1937 } |
| 1937 | 1938 |
| 1938 } // namespace views | 1939 } // namespace views |
| OLD | NEW |