summaryrefslogtreecommitdiffstats
path: root/platform/x11/os_x11.cpp
diff options
context:
space:
mode:
authorMartin Capitanio <capnm@capitanio.org>2018-09-15 20:54:22 +0200
committerMartin Capitanio <capnm@capitanio.org>2018-09-15 20:54:22 +0200
commit64cecf9d61eccb45f939b33cc752f336682cdda1 (patch)
tree9cd98a64ff3e0c3a228e06bc09df17ba5816e27f /platform/x11/os_x11.cpp
parent2cf024ed916abf565011b254ea4f69c04781964c (diff)
downloadredot-engine-64cecf9d61eccb45f939b33cc752f336682cdda1.tar.gz
Fix set_default_cursor_shape interaction with Control nodes
Do not call `set_cursor_shape` when the cursor is inside the `Control` node. Make it work for x11 in MOUSE_MODE_CONFINED.
Diffstat (limited to 'platform/x11/os_x11.cpp')
-rw-r--r--platform/x11/os_x11.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 24dfe541f9..7117317523 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -2524,13 +2524,16 @@ void OS_X11::set_cursor_shape(CursorShape p_shape) {
ERR_FAIL_INDEX(p_shape, CURSOR_MAX);
- if (p_shape == current_cursor)
+ if (p_shape == current_cursor) {
return;
- if (mouse_mode == MOUSE_MODE_VISIBLE && mouse_mode != MOUSE_MODE_CONFINED) {
- if (cursors[p_shape] != None)
+ }
+
+ if (mouse_mode == MOUSE_MODE_VISIBLE || mouse_mode == MOUSE_MODE_CONFINED) {
+ if (cursors[p_shape] != None) {
XDefineCursor(x11_display, x11_window, cursors[p_shape]);
- else if (cursors[CURSOR_ARROW] != None)
+ } else if (cursors[CURSOR_ARROW] != None) {
XDefineCursor(x11_display, x11_window, cursors[CURSOR_ARROW]);
+ }
}
current_cursor = p_shape;