mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-09 17:49:01 +00:00
Add option for Never Hide Mouse Cursor
Instead of having a single GUI checkbox for "Always Hide Mouse Cursor", I have instead opted to use radio buttons so the user can swap between different states of mouse visibility. "Movement" is the default behavior, "Never" will hide the mouse cursor the entire time the game is running, and "Always" will keep the mouse cursor always visible.
This commit is contained in:
parent
5145853351
commit
2aa400e72f
9 changed files with 99 additions and 36 deletions
|
@ -70,7 +70,7 @@ PlatformX11::~PlatformX11()
|
|||
|
||||
if (m_display)
|
||||
{
|
||||
if (SConfig::GetInstance().bHideCursor)
|
||||
if (SConfig::GetInstance().m_show_cursor == SConfig::ShowCursor::Never)
|
||||
XFreeCursor(m_display, m_blank_cursor);
|
||||
|
||||
XCloseDisplay(m_display);
|
||||
|
@ -115,7 +115,7 @@ bool PlatformX11::Init()
|
|||
m_xrr_config = new X11Utils::XRRConfiguration(m_display, m_window);
|
||||
#endif
|
||||
|
||||
if (SConfig::GetInstance().bHideCursor)
|
||||
if (SConfig::GetInstance().m_show_cursor == SConfig::ShowCursor::Never)
|
||||
{
|
||||
// make a blank cursor
|
||||
Pixmap Blank;
|
||||
|
@ -200,13 +200,13 @@ void PlatformX11::ProcessEvents()
|
|||
{
|
||||
if (Core::GetState() == Core::State::Running)
|
||||
{
|
||||
if (SConfig::GetInstance().bHideCursor)
|
||||
if (SConfig::GetInstance().m_show_cursor == SConfig::ShowCursor::Never)
|
||||
XUndefineCursor(m_display, m_window);
|
||||
Core::SetState(Core::State::Paused);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SConfig::GetInstance().bHideCursor)
|
||||
if (SConfig::GetInstance().m_show_cursor == SConfig::ShowCursor::Never)
|
||||
XDefineCursor(m_display, m_window, m_blank_cursor);
|
||||
Core::SetState(Core::State::Running);
|
||||
}
|
||||
|
@ -243,14 +243,15 @@ void PlatformX11::ProcessEvents()
|
|||
case FocusIn:
|
||||
{
|
||||
m_window_focus = true;
|
||||
if (SConfig::GetInstance().bHideCursor && Core::GetState() != Core::State::Paused)
|
||||
if (SConfig::GetInstance().m_show_cursor == SConfig::ShowCursor::Never &&
|
||||
Core::GetState() != Core::State::Paused)
|
||||
XDefineCursor(m_display, m_window, m_blank_cursor);
|
||||
}
|
||||
break;
|
||||
case FocusOut:
|
||||
{
|
||||
m_window_focus = false;
|
||||
if (SConfig::GetInstance().bHideCursor)
|
||||
if (SConfig::GetInstance().m_show_cursor == SConfig::ShowCursor::Never)
|
||||
XUndefineCursor(m_display, m_window);
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue