Commit f049f6e1 authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

chromeos: fix opacity in ash

The client was not always passing in the right translucent value, leading
to the window being marked opaque on the server when it isn't.

BUG=849380
TEST=none

Change-Id: I39f73a9ede381f0310a8532bc76ce700007f1352
Reviewed-on: https://chromium-review.googlesource.com/1103701Reviewed-by: default avatarFady Samuel <fsamuel@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568149}
parent 38ae900d
......@@ -294,15 +294,10 @@ bool DesktopWindowTreeHostMus::ShouldSendClientAreaToServer() const {
}
void DesktopWindowTreeHostMus::Init(const Widget::InitParams& params) {
// |TYPE_WINDOW| and |TYPE_PANEL| are forced to transparent as otherwise the
// window is opaque and the client decorations drawn by the window manager
// would not be seen.
const bool transparent =
params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW ||
params.type == Widget::InitParams::TYPE_WINDOW ||
params.type == Widget::InitParams::TYPE_PANEL;
content_window()->SetTransparent(transparent);
window()->SetTransparent(transparent);
const bool translucent =
MusClient::ShouldMakeWidgetWindowsTranslucent(params);
content_window()->SetTransparent(translucent);
window()->SetTransparent(translucent);
window()->SetProperty(aura::client::kShowStateKey, params.show_state);
......
......@@ -171,6 +171,16 @@ bool MusClient::ShouldCreateDesktopNativeWidgetAura(
!init_params.child;
}
// static
bool MusClient::ShouldMakeWidgetWindowsTranslucent(
const Widget::InitParams& params) {
// |TYPE_WINDOW| and |TYPE_PANEL| are forced to translucent so that the
// window manager can draw the client decorations.
return params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW ||
params.type == Widget::InitParams::TYPE_WINDOW ||
params.type == Widget::InitParams::TYPE_PANEL;
}
// static
std::map<std::string, std::vector<uint8_t>>
MusClient::ConfigurePropertiesFromParams(
......@@ -189,8 +199,8 @@ MusClient::ConfigurePropertiesFromParams(
mojo::ConvertTo<TransportType>(init_params.CanActivate());
properties[WindowManager::kTranslucent_InitProperty] =
mojo::ConvertTo<TransportType>(init_params.opacity ==
Widget::InitParams::TRANSLUCENT_WINDOW);
mojo::ConvertTo<TransportType>(
ShouldMakeWidgetWindowsTranslucent(init_params));
if (!init_params.bounds.IsEmpty()) {
properties[WindowManager::kBounds_InitProperty] =
......
......@@ -103,6 +103,10 @@ class VIEWS_MUS_EXPORT MusClient : public aura::WindowTreeClientDelegate,
static bool ShouldCreateDesktopNativeWidgetAura(
const Widget::InitParams& init_params);
// Returns true if the windows backing the Widget should be made translucent.
static bool ShouldMakeWidgetWindowsTranslucent(
const Widget::InitParams& params);
// Returns the properties to supply to mus when creating a window.
static std::map<std::string, std::vector<uint8_t>>
ConfigurePropertiesFromParams(const Widget::InitParams& init_params);
......
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