Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc |
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc |
index aeadc78f2fe40a9863c39daa451852a86f78cf9f..3f96e65ed1cc15704ec15ffacdc52553403db7b7 100644 |
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc |
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc |
@@ -1156,23 +1156,29 @@ void DesktopWindowTreeHostX11::InitX11Window( |
if (swa.override_redirect) |
attribute_mask |= CWOverrideRedirect; |
- Visual* visual; |
- int depth; |
- ui::ChooseVisualForWindow(true, &visual, &depth); |
- if (depth == 32) { |
- attribute_mask |= CWColormap; |
- swa.colormap = |
- XCreateColormap(xdisplay_, x_root_window_, visual, AllocNone); |
- |
- // x.org will BadMatch if we don't set a border when the depth isn't the |
- // same as the parent depth. |
- attribute_mask |= CWBorderPixel; |
- swa.border_pixel = 0; |
- |
- // A compositing manager is required to support transparency. |
- use_argb_visual_ = |
- XGetSelectionOwner(xdisplay_, atom_cache_.GetAtom("_NET_WM_CM_S0")) != |
- None; |
+ bool enable_transparent_visuals = |
+ params.type == Widget::InitParams::TYPE_DRAG || |
+ params.type == Widget::InitParams::TYPE_WINDOW; |
+ |
+ Visual* visual = CopyFromParent; |
+ int depth = CopyFromParent; |
+ if (enable_transparent_visuals) { |
+ ui::ChooseVisualForWindow(enable_transparent_visuals, &visual, &depth); |
piman
2016/08/24 17:21:49
Ignoring the statics for a second, ChooseVisualFor
|
+ if (depth == 32) { |
+ attribute_mask |= CWColormap; |
+ swa.colormap = |
+ XCreateColormap(xdisplay_, x_root_window_, visual, AllocNone); |
+ |
+ // x.org will BadMatch if we don't set a border when the depth isn't the |
+ // same as the parent depth. |
+ attribute_mask |= CWBorderPixel; |
+ swa.border_pixel = 0; |
+ |
+ // A compositing manager is required to support transparency. |
+ use_argb_visual_ = |
+ XGetSelectionOwner(xdisplay_, atom_cache_.GetAtom("_NET_WM_CM_S0")) != |
+ None; |
+ } |
} |
bounds_in_pixels_ = ToPixelRect(params.bounds); |