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 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1178 ui::SetAtomArrayProperty(xwindow_, | 1178 ui::SetAtomArrayProperty(xwindow_, |
1179 "_NET_WM_STATE", | 1179 "_NET_WM_STATE", |
1180 "ATOM", | 1180 "ATOM", |
1181 state_atom_list); | 1181 state_atom_list); |
1182 } | 1182 } |
1183 | 1183 |
1184 if (!params.wm_class_name.empty() || !params.wm_class_class.empty()) { | 1184 if (!params.wm_class_name.empty() || !params.wm_class_class.empty()) { |
1185 ui::SetWindowClassHint( | 1185 ui::SetWindowClassHint( |
1186 xdisplay_, xwindow_, params.wm_class_name, params.wm_class_class); | 1186 xdisplay_, xwindow_, params.wm_class_name, params.wm_class_class); |
1187 } | 1187 } |
1188 if (!params.wm_role_name.empty() || | 1188 |
1189 params.type == Widget::InitParams::TYPE_POPUP) { | 1189 std::string wm_role_name = params.wm_role_name; |
sadrul
2014/11/03 17:14:03
Can you use a const char* here instead of making c
mithro-old
2014/11/04 05:48:44
Done.
| |
1190 const char kX11WindowRolePopup[] = "popup"; | 1190 // If the widget isn't overriding the role, provide a default value for popup |
1191 ui::SetWindowRole(xdisplay_, xwindow_, params.wm_role_name.empty() ? | 1191 // and bubble types. |
1192 std::string(kX11WindowRolePopup) : params.wm_role_name); | 1192 if (wm_role_name.empty()) { |
1193 switch (params.type) { | |
1194 case Widget::InitParams::TYPE_POPUP: { | |
1195 const char kX11WindowRolePopup[] = "popup"; | |
1196 wm_role_name = std::string(kX11WindowRolePopup); | |
Elliot Glaysher
2014/10/31 19:42:15
It should be safe here to just say `wm_role_name =
mithro-old
2014/11/04 05:48:44
Obsolete by sadrul's comments.
| |
1197 break; | |
1198 } | |
1199 case Widget::InitParams::TYPE_BUBBLE: { | |
1200 const char kX11WindowRoleBubble[] = "bubble"; | |
1201 wm_role_name = std::string(kX11WindowRoleBubble); | |
1202 break; | |
1203 } | |
1204 default: | |
1205 break; | |
1206 } | |
1207 } | |
1208 if (!wm_role_name.empty()) { | |
sadrul
2014/11/03 17:14:03
No {} for single line blocks
mithro-old
2014/11/04 05:48:44
Done.
| |
1209 ui::SetWindowRole(xdisplay_, xwindow_, wm_role_name); | |
1193 } | 1210 } |
1194 | 1211 |
1195 if (params.remove_standard_frame) { | 1212 if (params.remove_standard_frame) { |
1196 // Setting _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED tells gnome-shell to not force | 1213 // Setting _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED tells gnome-shell to not force |
1197 // fullscreen on the window when it matches the desktop size. | 1214 // fullscreen on the window when it matches the desktop size. |
1198 ui::SetHideTitlebarWhenMaximizedProperty(xwindow_, | 1215 ui::SetHideTitlebarWhenMaximizedProperty(xwindow_, |
1199 ui::HIDE_TITLEBAR_WHEN_MAXIMIZED); | 1216 ui::HIDE_TITLEBAR_WHEN_MAXIMIZED); |
1200 } | 1217 } |
1201 | 1218 |
1202 // If we have a parent, record the parent/child relationship. We use this | 1219 // If we have a parent, record the parent/child relationship. We use this |
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1943 if (linux_ui) { | 1960 if (linux_ui) { |
1944 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); | 1961 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); |
1945 if (native_theme) | 1962 if (native_theme) |
1946 return native_theme; | 1963 return native_theme; |
1947 } | 1964 } |
1948 | 1965 |
1949 return ui::NativeTheme::instance(); | 1966 return ui::NativeTheme::instance(); |
1950 } | 1967 } |
1951 | 1968 |
1952 } // namespace views | 1969 } // namespace views |
OLD | NEW |