This commit is contained in:
Taeho Kim 2017-10-02 09:52:27 +09:00
parent 7c1c8f323c
commit 7df5182901

View file

@ -816,14 +816,14 @@ bool NativeWindowViews::HasShadow() {
void NativeWindowViews::SetOpacity(const double opacity) { void NativeWindowViews::SetOpacity(const double opacity) {
#if defined(OS_WIN) #if defined(OS_WIN)
HWND hwnd = GetAcceleratedWidget();
if (!layered_) { if (!layered_) {
LONG ex_style = ::GetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE); LONG ex_style = ::GetWindowLong(hwnd, GWL_EXSTYLE);
ex_style |= WS_EX_LAYERED; ex_style |= WS_EX_LAYERED;
::SetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE, ex_style); ::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style);
layered_ = true; layered_ = true;
} }
::SetLayeredWindowAttributes(hwnd, 0, opacity * 255, LWA_ALPHA);
::SetLayeredWindowAttributes(GetAcceleratedWidget(), 0, opacity * 255, LWA_ALPHA);
#endif #endif
} }