Commit adc543fe authored by Peng Huang's avatar Peng Huang Committed by Commit Bot

Fix the flash for any new created window.

The flash is because the child window created by GLSurfaceGLX doesn't
match the visual of parent window. Fix the problem by always creating
parent window with the same visual.

Bug: 956061
Change-Id: I88cb65b4a0313be6fdea1bd8d6770d351500ccbb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1591946Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#656497}
parent 762630e4
......@@ -1426,24 +1426,15 @@ void DesktopWindowTreeHostX11::InitX11Window(
if (override_redirect_)
attribute_mask |= CWOverrideRedirect;
bool enable_transparent_visuals;
switch (params.opacity) {
case Widget::InitParams::OPAQUE_WINDOW:
enable_transparent_visuals = false;
break;
case Widget::InitParams::TRANSLUCENT_WINDOW:
enable_transparent_visuals = true;
break;
case Widget::InitParams::INFER_OPACITY:
default:
enable_transparent_visuals = params.type == Widget::InitParams::TYPE_DRAG;
}
Visual* visual = CopyFromParent;
int depth = CopyFromParent;
Colormap colormap = CopyFromParent;
// GLSurfaceGLX always create child window with alpha channel. If the parent
// window doesn't have alpha channel, it causes flash, so always request argb
// visual.
ui::XVisualManager::GetInstance()->ChooseVisualForWindow(
enable_transparent_visuals, &visual, &depth, &colormap,
true /* want_argb_visual */, &visual, &depth, &colormap,
&use_argb_visual_);
if (colormap != CopyFromParent) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment