Unverified Commit 7a250b57 by bruvzg

macOS, prevent multiple CGDisplayHideCursor calls unpaired with CGDisplayShowCursor.

parent 492625db
......@@ -1937,10 +1937,14 @@ void DisplayServerOSX::mouse_set_mode(MouseMode p_mode) {
// Apple Docs state that the display parameter is not used.
// "This parameter is not used. By default, you may pass kCGDirectMainDisplay."
// https://developer.apple.com/library/mac/documentation/graphicsimaging/reference/Quartz_Services_Ref/Reference/reference.html
CGDisplayHideCursor(kCGDirectMainDisplay);
if (mouse_mode == MOUSE_MODE_VISIBLE || mouse_mode == MOUSE_MODE_CONFINED) {
CGDisplayHideCursor(kCGDirectMainDisplay);
}
CGAssociateMouseAndMouseCursorPosition(false);
} else if (p_mode == MOUSE_MODE_HIDDEN) {
CGDisplayHideCursor(kCGDirectMainDisplay);
if (mouse_mode == MOUSE_MODE_VISIBLE || mouse_mode == MOUSE_MODE_CONFINED) {
CGDisplayHideCursor(kCGDirectMainDisplay);
}
CGAssociateMouseAndMouseCursorPosition(true);
} else {
CGDisplayShowCursor(kCGDirectMainDisplay);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment