#include "ui/views/window/client_view.h"
#include "ui/views/widget/native_widget_private.h"
#include "ui/views/widget/widget.h"
+#include "ui/wm/core/shadow_types.h"
#if defined(USE_X11)
#include "atom/browser/browser.h"
params.type = views::Widget::InitParams::TYPE_WINDOW;
params.remove_standard_frame = !has_frame_;
+ if (transparent_)
+ params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
+
#if defined(USE_X11)
std::string name = Browser::Get()->GetName();
// Set WM_WINDOW_ROLE.
bounds = ContentBoundsToWindowBounds(bounds);
#if defined(OS_WIN)
- if (!has_frame_) {
+ if (!transparent_ && !has_frame_) {
// Set Window style so that we get a minimize and maximize animation when
// frameless.
DWORD frame_style = WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX |
WS_CAPTION;
::SetWindowLong(GetAcceleratedWidget(), GWL_STYLE, frame_style);
}
+
+ if (transparent_) {
+ // Transparent window on Windows has to have WS_EX_COMPOSITED style.
+ LONG ex_style = ::GetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE);
+ ex_style |= WS_EX_COMPOSITED;
+ ::SetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE, ex_style);
+ }
#endif
// TODO(zcbenz): This was used to force using native frame on Windows 2003, we
window_->FrameTypeChanged();
}
+ // The given window is most likely not rectangular since it uses
+ // transparency and has no standard frame, don't show a shadow for it.
+ if (transparent_ && !has_frame_)
+ wm::SetShadowType(GetNativeWindow(), wm::SHADOW_TYPE_NONE);
+
window_->UpdateWindowIcon();
window_->CenterWindow(bounds.size());
Layout();