summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2012-03-19 06:54:02 -0700
committerShawn Hoffman <godisgovernment@gmail.com>2012-03-19 06:54:02 -0700
commit35a5a3b9d437f6150cfdfe45fefcb922cdd7d52b (patch)
tree5a7e949ad7b555670703a41dd8de2838d06dc172 /Source
parentc3a537728f9cb05af98ef7287cabfb1f09f6f4ec (diff)
Fix "Hid cursor" causing a wxWidgets warning
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinWX/Src/Frame.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp
index e7c4fca067..a089562743 100644
--- a/Source/Core/DolphinWX/Src/Frame.cpp
+++ b/Source/Core/DolphinWX/Src/Frame.cpp
@@ -500,19 +500,32 @@ void CFrame::OnActive(wxActivateEvent& event)
{
if (event.GetActive() && event.GetEventObject() == m_RenderFrame)
{
-#ifdef _WIN32
+ // 32x32, 8bpp b/w image
+ // We want all transparent, so we can just use the same buffer for
+ // the "image" as for the transparency mask
+ static const char cursor_data[32 * 32] = { 0 };
+
+#ifdef __WXMSW__
+ wxBitmap cursor_bitmap(cursor_data, 32, 32);
+ cursor_bitmap.SetMask(new wxMask(cursor_bitmap));
+ wxCursor cursor_transparent = wxCursor(cursor_bitmap.ConvertToImage());
+
::SetFocus((HWND)m_RenderParent->GetHandle());
#else
+ wxCursor cursor_transparent = wxCursor(cursor_data, 32, 32, 6, 14,
+ cursor_data, wxWHITE, wxBLACK);
+
m_RenderParent->SetFocus();
#endif
+
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor &&
Core::GetState() == Core::CORE_RUN)
- m_RenderParent->SetCursor(wxCURSOR_BLANK);
+ m_RenderParent->SetCursor(cursor_transparent);
}
else
{
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
- m_RenderParent->SetCursor(wxCURSOR_ARROW);
+ m_RenderParent->SetCursor(wxNullCursor);
}
}
event.Skip();
@@ -629,11 +642,6 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
m_RenderFrame->SetTitle(event.GetString());
break;
- case WM_USER_CREATE:
- if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
- m_RenderParent->SetCursor(wxCURSOR_BLANK);
- break;
-
case IDM_WINDOWSIZEREQUEST:
{
std::pair<int, int> *win_size = (std::pair<int, int> *)(event.GetClientData());