소스 검색

Attempt to hide cursor only once the window is visible

This fixes the cursor being initially visible on OSX.
Vincent Lang 8 년 전
부모
커밋
8d103dad9e
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 3
      src/system/SystemComponent.cpp
  2. 2 0
      src/ui/KonvergoWindow.cpp

+ 1 - 3
src/system/SystemComponent.cpp

@@ -41,14 +41,12 @@ QMap<SystemComponent::PlatformArch, QString> g_platformArchNames = {
 
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-SystemComponent::SystemComponent(QObject* parent) : ComponentBase(parent), m_platformType(platformTypeUnknown), m_platformArch(platformArchUnknown), m_doLogMessages(false), m_cursorVisible(false)
+SystemComponent::SystemComponent(QObject* parent) : ComponentBase(parent), m_platformType(platformTypeUnknown), m_platformArch(platformArchUnknown), m_doLogMessages(false), m_cursorVisible(true)
 {
   m_mouseOutTimer = new QTimer(this);
   m_mouseOutTimer->setSingleShot(true);
   connect(m_mouseOutTimer, &QTimer::timeout, [&] () { setCursorVisibility(false); });
 
-  m_mouseOutTimer->start(MOUSE_TIMEOUT);
-
 // define OS Type
 #if defined(Q_OS_MAC)
   m_platformType = platformTypeOsx;

+ 2 - 0
src/ui/KonvergoWindow.cpp

@@ -411,6 +411,8 @@ void KonvergoWindow::onVisibilityChanged(QWindow::Visibility visibility)
 
     bool fs = visibility == QWindow::FullScreen;
     SettingsComponent::Get().setValue(SETTINGS_SECTION_MAIN, "fullscreen", fs);
+
+    SystemComponent::Get().setCursorVisibility(false);
   }
 
   if (visibility == QWindow::Windowed)