Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1117)

Unified Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc

Issue 2268973004: Fix missing shadows for tooltip and menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698