| 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 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1351 window_type = atom_cache_.GetAtom("_NET_WM_WINDOW_TYPE_NORMAL"); | 1351 window_type = atom_cache_.GetAtom("_NET_WM_WINDOW_TYPE_NORMAL"); |
| 1352 break; | 1352 break; |
| 1353 } | 1353 } |
| 1354 // An in-activatable window should not interact with the system wm. | 1354 // An in-activatable window should not interact with the system wm. |
| 1355 if (!activatable_) | 1355 if (!activatable_) |
| 1356 swa.override_redirect = True; | 1356 swa.override_redirect = True; |
| 1357 | 1357 |
| 1358 if (swa.override_redirect) | 1358 if (swa.override_redirect) |
| 1359 attribute_mask |= CWOverrideRedirect; | 1359 attribute_mask |= CWOverrideRedirect; |
| 1360 | 1360 |
| 1361 Visual* visual; | 1361 const bool enable_transparent_visuals = |
| 1362 int depth; | 1362 params.type == Widget::InitParams::TYPE_DRAG || |
| 1363 ui::ChooseVisualForWindow(true, &visual, &depth); | 1363 params.type == Widget::InitParams::TYPE_WINDOW; |
| 1364 if (depth == 32) { | 1364 |
| 1365 Visual* visual = CopyFromParent; |
| 1366 int depth = CopyFromParent; |
| 1367 ui::ChooseVisualForWindow(enable_transparent_visuals, &visual, &depth); |
| 1368 if (enable_transparent_visuals && depth == 32) { |
| 1365 attribute_mask |= CWColormap; | 1369 attribute_mask |= CWColormap; |
| 1366 swa.colormap = | 1370 swa.colormap = |
| 1367 XCreateColormap(xdisplay_, x_root_window_, visual, AllocNone); | 1371 XCreateColormap(xdisplay_, x_root_window_, visual, AllocNone); |
| 1368 | 1372 |
| 1369 // x.org will BadMatch if we don't set a border when the depth isn't the | 1373 // x.org will BadMatch if we don't set a border when the depth isn't the |
| 1370 // same as the parent depth. | 1374 // same as the parent depth. |
| 1371 attribute_mask |= CWBorderPixel; | 1375 attribute_mask |= CWBorderPixel; |
| 1372 swa.border_pixel = 0; | 1376 swa.border_pixel = 0; |
| 1373 | 1377 |
| 1374 // A compositing manager is required to support transparency. | 1378 // A compositing manager is required to support transparency. |
| (...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2308 if (linux_ui) { | 2312 if (linux_ui) { |
| 2309 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); | 2313 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); |
| 2310 if (native_theme) | 2314 if (native_theme) |
| 2311 return native_theme; | 2315 return native_theme; |
| 2312 } | 2316 } |
| 2313 | 2317 |
| 2314 return ui::NativeThemeAura::instance(); | 2318 return ui::NativeThemeAura::instance(); |
| 2315 } | 2319 } |
| 2316 | 2320 |
| 2317 } // namespace views | 2321 } // namespace views |
| OLD | NEW |