diff options
| author | Leo Lam <leolino.lam@gmail.com> | 2017-08-11 17:34:46 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-11 17:34:46 +0800 |
| commit | 438610a58de2da049c6eb867addb3abb50fad6db (patch) | |
| tree | ce759bea782310adab7f0c971ab7ad9fa691c6f4 /Source/Core/DolphinWX/Frame.cpp | |
| parent | 54778303ee1e85a4e70d33c548f969c4bacef92c (diff) | |
| parent | d38987e1e80b2221e80f2e1bf469eff6a4ac1c55 (diff) | |
Merge pull request #5748 from nitrousox1de/hide-mouse-delay-fullscreen
Hide mouse delay fullscreen
Diffstat (limited to 'Source/Core/DolphinWX/Frame.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Frame.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index ba689ac063..5977fd3ba5 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -449,6 +449,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()); @@ -1138,6 +1142,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) { @@ -1713,6 +1724,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()) |
