summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Frame.cpp
diff options
context:
space:
mode:
authorAndrew <andrew.li@tufts.edu>2017-06-24 20:10:23 -0400
committerAndrew <andrew.li@tufts.edu>2017-07-14 22:28:52 -0400
commit3095f585dde9c525fbe27af4a663d7009e8fd37f (patch)
tree5836e34d25bb61bbbaa52ee6e4b59ea2c0bacf10 /Source/Core/DolphinWX/Frame.cpp
parentb440dbd9981bcb3a1c8315db3a0e38e9bd4c62bd (diff)
Hide mouse cursor after delay in DolphinWX
Diffstat (limited to 'Source/Core/DolphinWX/Frame.cpp')
-rw-r--r--Source/Core/DolphinWX/Frame.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp
index 29a7b526c3..ec46436632 100644
--- a/Source/Core/DolphinWX/Frame.cpp
+++ b/Source/Core/DolphinWX/Frame.cpp
@@ -448,6 +448,10 @@ CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, wxRect geo
Bind(wxEVT_TIMER, &CFrame::PollHotkeys, this, m_poll_hotkey_timer.GetId());
m_poll_hotkey_timer.Start(1000 / 60, wxTIMER_CONTINUOUS);
+ m_cursor_timer.SetOwner(this);
+ Bind(wxEVT_TIMER, &CFrame::HandleCursorTimer, this, m_cursor_timer.GetId());
+ m_cursor_timer.StartOnce(MOUSE_HIDE_DELAY);
+
// Shut down cleanly on SIGINT, SIGTERM (Unix) and on various signals on Windows
m_handle_signal_timer.SetOwner(this);
Bind(wxEVT_TIMER, &CFrame::HandleSignal, this, m_handle_signal_timer.GetId());
@@ -1122,6 +1126,13 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
void CFrame::OnMouse(wxMouseEvent& event)
{
+ if (!SConfig::GetInstance().bHideCursor && main_frame->RendererHasFocus() &&
+ Core::GetState() == Core::State::Running)
+ {
+ m_render_parent->SetCursor(wxNullCursor);
+ m_cursor_timer.StartOnce(MOUSE_HIDE_DELAY);
+ }
+
// next handlers are all for FreeLook, so we don't need to check them if disabled
if (!g_Config.bFreeLook)
{
@@ -1699,6 +1710,13 @@ void CFrame::HandleFrameSkipHotkeys()
}
}
+void CFrame::HandleCursorTimer(wxTimerEvent& event)
+{
+ if (!SConfig::GetInstance().bHideCursor && main_frame->RendererHasFocus() &&
+ Core::GetState() == Core::State::Running)
+ m_render_parent->SetCursor(wxCURSOR_BLANK);
+}
+
void CFrame::HandleSignal(wxTimerEvent& event)
{
if (!s_shutdown_signal_received.TestAndClear())