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 38a416bb19ca7db7b8690c143237c1cf8435b6c9..6be0bf698ecb4a870ec4beeee8458dd67e3d580e 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 |
@@ -1359,28 +1359,25 @@ void DesktopWindowTreeHostX11::InitX11Window( |
if (swa.override_redirect) |
attribute_mask |= CWOverrideRedirect; |
+ // TODO(thomasanderson): make this only TYPE_DRAG |
const bool enable_transparent_visuals = |
- params.type == Widget::InitParams::TYPE_DRAG || |
- params.type == Widget::InitParams::TYPE_WINDOW; |
+ params.type == Widget::InitParams::TYPE_WINDOW || |
+ params.type == Widget::InitParams::TYPE_DRAG; |
Visual* visual = CopyFromParent; |
int depth = CopyFromParent; |
- ui::ChooseVisualForWindow(enable_transparent_visuals, &visual, &depth); |
- if (enable_transparent_visuals && depth == 32) { |
- attribute_mask |= CWColormap; |
- swa.colormap = |
- XCreateColormap(xdisplay_, x_root_window_, visual, AllocNone); |
+ Colormap colormap = CopyFromParent; |
+ ui::XVisualManager::GetInstance()->ChooseVisualForWindow( |
+ enable_transparent_visuals, &visual, &depth, &colormap, |
+ &use_argb_visual_); |
- // 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; |
+ attribute_mask |= CWColormap; |
+ swa.colormap = colormap; |
- // A compositing manager is required to support transparency. |
- use_argb_visual_ = |
- XGetSelectionOwner(xdisplay_, atom_cache_.GetAtom("_NET_WM_CM_S0")) != |
- None; |
- } |
+ // 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; |
bounds_in_pixels_ = ToPixelRect(params.bounds); |
bounds_in_pixels_.set_size(AdjustSize(bounds_in_pixels_.size())); |