summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-09-15 11:56:45 +0200
committerGitHub <noreply@github.com>2018-09-15 11:56:45 +0200
commit82e69f38eeb4a41f74527248bf257ba50d375870 (patch)
tree71f8171f21b47609a9ad9b4e8a7a8850b16f85d7 /platform
parent4547e223933d1c1b24a526b3d632a2f96cdd6c8b (diff)
parent04aef23585376c3e648c086e39a58e7f5fd41f7d (diff)
Merge pull request #21973 from guilhermefelipecgs/fix_default_cursor_shape
Some fixes to mouse's cursor and shape
Diffstat (limited to 'platform')
-rw-r--r--platform/osx/os_osx.mm6
-rw-r--r--platform/windows/os_windows.cpp6
-rw-r--r--platform/x11/os_x11.cpp5
3 files changed, 11 insertions, 6 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index c0de4e3f2a..b98113baeb 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -1662,7 +1662,7 @@ void OS_OSX::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
[cursors[p_shape] release];
cursors[p_shape] = cursor;
- if (p_shape == CURSOR_ARROW) {
+ if (p_shape == cursor_shape) {
[cursor set];
}
@@ -1671,8 +1671,10 @@ void OS_OSX::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
} else {
// Reset to default system cursor
cursors[p_shape] = NULL;
+
+ CursorShape c = cursor_shape;
cursor_shape = CURSOR_MAX;
- set_cursor_shape(p_shape);
+ set_cursor_shape(c);
}
}
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 67fc1c7496..f63aebbbd3 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -2311,7 +2311,7 @@ void OS_Windows::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shap
cursors[p_shape] = CreateIconIndirect(&iconinfo);
- if (p_shape == CURSOR_ARROW) {
+ if (p_shape == cursor_shape) {
SetCursor(cursors[p_shape]);
}
@@ -2328,8 +2328,10 @@ void OS_Windows::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shap
} else {
// Reset to default system cursor
cursors[p_shape] = NULL;
+
+ CursorShape c = cursor_shape;
cursor_shape = CURSOR_MAX;
- set_cursor_shape(p_shape);
+ set_cursor_shape(c);
}
}
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index b80a20ce40..24dfe541f9 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -2606,7 +2606,7 @@ void OS_X11::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
// Save it for a further usage
cursors[p_shape] = XcursorImageLoadCursor(x11_display, cursor_image);
- if (p_shape == CURSOR_ARROW) {
+ if (p_shape == current_cursor) {
XDefineCursor(x11_display, x11_window, cursors[p_shape]);
}
@@ -2618,8 +2618,9 @@ void OS_X11::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
cursors[p_shape] = XcursorImageLoadCursor(x11_display, img[p_shape]);
}
+ CursorShape c = current_cursor;
current_cursor = CURSOR_MAX;
- set_cursor_shape(p_shape);
+ set_cursor_shape(c);
}
}