Fixed animated cursor issue

This commit is contained in:
Birunthan Mohanathas 2012-07-13 21:29:30 +03:00
parent f9c30e4c83
commit 216d58da31

View File

@ -85,30 +85,31 @@ void CMouse::ReadOptions(CConfigParser& parser, const WCHAR* section, CMeterWind
m_CursorType = MOUSECURSOR_PEN; m_CursorType = MOUSECURSOR_PEN;
} }
else if (wcschr(mouseCursor, L'.')) else if (wcschr(mouseCursor, L'.'))
{
// Load custom cursor
std::wstring cursorPath = meterWindow->GetResourcesPath();
cursorPath += L"Cursors\\";
cursorPath += mouseCursor;
m_CustomCursor = LoadCursorFromFile(cursorPath.c_str());
if (m_CustomCursor)
{ {
m_CursorType = MOUSECURSOR_CUSTOM; m_CursorType = MOUSECURSOR_CUSTOM;
} }
else else
{
// Inherit from [Rainmeter].
m_CursorType = meterWindow->GetMouse().m_CursorType;
if (m_CursorType == MOUSECURSOR_CUSTOM)
{
mouseCursor = meterWindow->GetParser().ReadString(L"Rainmeter", L"MouseActionCursor", L"").c_str();;
}
}
if (m_CursorType == MOUSECURSOR_CUSTOM)
{
std::wstring cursorPath = meterWindow->GetResourcesPath();
cursorPath += L"Cursors\\";
cursorPath += mouseCursor;
m_CustomCursor = LoadCursorFromFile(cursorPath.c_str());
if (!m_CustomCursor)
{ {
m_CursorType = MOUSECURSOR_ARROW; m_CursorType = MOUSECURSOR_ARROW;
LogWithArgs(LOG_ERROR, L"Invalid cursor: %s", cursorPath.c_str()); LogWithArgs(LOG_ERROR, L"Invalid cursor: %s", cursorPath.c_str());
} }
} }
else
{
m_CursorType = meterWindow->GetMouse().m_CursorType;
if (meterWindow->GetMouse().m_CustomCursor)
{
m_CustomCursor = CopyCursor(meterWindow->GetMouse().m_CustomCursor);
}
}
} }
HCURSOR CMouse::GetCursor() const HCURSOR CMouse::GetCursor() const