macOS, prevent multiple CGDisplayHideCursor calls unpaired with CGDisplayShowCursor.
(cherry picked from commit 7a250b579f
)
This commit is contained in:
parent
d2aa3031dc
commit
e2675e9462
1 changed files with 6 additions and 2 deletions
|
@ -3072,10 +3072,14 @@ void OS_OSX::set_mouse_mode(MouseMode p_mode) {
|
||||||
// Apple Docs state that the display parameter is not used.
|
// Apple Docs state that the display parameter is not used.
|
||||||
// "This parameter is not used. By default, you may pass kCGDirectMainDisplay."
|
// "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
|
// 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);
|
CGAssociateMouseAndMouseCursorPosition(false);
|
||||||
} else if (p_mode == MOUSE_MODE_HIDDEN) {
|
} else if (p_mode == MOUSE_MODE_HIDDEN) {
|
||||||
CGDisplayHideCursor(kCGDirectMainDisplay);
|
if (mouse_mode == MOUSE_MODE_VISIBLE || mouse_mode == MOUSE_MODE_CONFINED) {
|
||||||
|
CGDisplayHideCursor(kCGDirectMainDisplay);
|
||||||
|
}
|
||||||
CGAssociateMouseAndMouseCursorPosition(true);
|
CGAssociateMouseAndMouseCursorPosition(true);
|
||||||
} else {
|
} else {
|
||||||
CGDisplayShowCursor(kCGDirectMainDisplay);
|
CGDisplayShowCursor(kCGDirectMainDisplay);
|
||||||
|
|
Loading…
Reference in a new issue