diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index 6528ab99..9bc655aa 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -423,7 +423,8 @@ void MeterWindow::Refresh(bool init, bool all) m_Hidden = m_WindowStartHidden; // Set the window region - UpdateWindow(m_AlphaValue, true); // Add/Remove layered flag + AddWindowExStyle(WS_EX_LAYERED); + UpdateWindow(m_AlphaValue); Update(true); if (m_BlurMode == BLURMODE_NONE) @@ -2636,7 +2637,7 @@ void MeterWindow::Redraw() } } - UpdateWindow(m_TransparencyValue, false, true); + UpdateWindow(m_TransparencyValue, true); m_Canvas->EndDraw(); } @@ -2810,13 +2811,8 @@ void MeterWindow::Update(bool refresh) ** Updates the window contents ** */ -void MeterWindow::UpdateWindow(int alpha, bool reset, bool canvasBeginDrawCalled) +void MeterWindow::UpdateWindow(int alpha, bool canvasBeginDrawCalled) { - if (reset) - { - AddWindowExStyle(WS_EX_LAYERED); - } - BLENDFUNCTION blendPixelFunction = {AC_SRC_OVER, 0, alpha, AC_SRC_ALPHA}; POINT ptWindowScreenPosition = {m_ScreenX, m_ScreenY}; POINT ptSrc = {0, 0}; diff --git a/Library/MeterWindow.h b/Library/MeterWindow.h index 45fe76e2..1401cf90 100644 --- a/Library/MeterWindow.h +++ b/Library/MeterWindow.h @@ -134,7 +134,7 @@ public: void Deactivate(); void Refresh(bool init, bool all = false); void Redraw(); - void RedrawWindow() { UpdateWindow(m_TransparencyValue, false); } + void RedrawWindow() { UpdateWindow(m_TransparencyValue); } void SetVariable(const std::wstring& variable, const std::wstring& value); void SetOption(const std::wstring& section, const std::wstring& option, const std::wstring& value, bool group); @@ -292,7 +292,7 @@ private: bool UpdateMeasure(Measure* measure, bool force); bool UpdateMeter(Meter* meter, bool& bActiveTransition, bool force); void Update(bool refresh); - void UpdateWindow(int alpha, bool reset, bool canvasBeginDrawCalled = false); + void UpdateWindow(int alpha, bool canvasBeginDrawCalled = false); void UpdateWindowTransparency(int alpha); void ReadOptions(); void WriteOptions(INT setting = OPTION_ALL);