소스 검색

OSX: set the mouse cursor to blank in addition to hiding

This changes OSX behavior to the same as the "portable" one, just that
on OSX also NSCursor hide/unhide is called.

Not entirely comfortable with this, because if the NSCursor method
doesn't work, it will appear as if everything is ok. But the cursor
could still become visible on notifications _if_ NSCursor fails, which
would be quite annoying.
Vincent Lang 8 년 전
부모
커밋
f2c4b49c8a
1개의 변경된 파일6개의 추가작업 그리고 5개의 파일을 삭제
  1. 6 5
      src/system/SystemComponent.cpp

+ 6 - 5
src/system/SystemComponent.cpp

@@ -191,19 +191,20 @@ void SystemComponent::setCursorVisibility(bool visible)
   m_cursorVisible = visible;
 
   if (visible)
+  {
+    qApp->restoreOverrideCursor();
     m_mouseOutTimer->start(MOUSE_TIMEOUT);
+  }
   else
+  {
+    qApp->setOverrideCursor(QCursor(Qt::BlankCursor));
     m_mouseOutTimer->stop();
+  }
 
 #ifdef Q_OS_MAC
   // OSX notifications will reset the cursor image (without Qt's knowledge). The
   // only thing we can do override this is using Cocoa's native cursor hiding.
   OSXUtils::SetCursorVisible(visible);
-#else
-  if (visible)
-    qApp->restoreOverrideCursor();
-  else
-    qApp->setOverrideCursor(QCursor(Qt::BlankCursor));
 #endif
 }