summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/x11/os_x11.cpp17
-rw-r--r--scene/gui/text_edit.cpp3
2 files changed, 14 insertions, 6 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 20c9dd6290..b80a20ce40 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -744,12 +744,15 @@ void OS_X11::set_mouse_mode(MouseMode p_mode) {
ERR_PRINT("NO GRAB");
}
- center.x = current_videomode.width / 2;
- center.y = current_videomode.height / 2;
- XWarpPointer(x11_display, None, x11_window,
- 0, 0, 0, 0, (int)center.x, (int)center.y);
+ if (mouse_mode == MOUSE_MODE_CAPTURED) {
+ center.x = current_videomode.width / 2;
+ center.y = current_videomode.height / 2;
+
+ XWarpPointer(x11_display, None, x11_window,
+ 0, 0, 0, 0, (int)center.x, (int)center.y);
- input->set_mouse_position(center);
+ input->set_mouse_position(center);
+ }
} else {
do_mouse_warp = false;
}
@@ -2067,6 +2070,10 @@ void OS_X11::process_xevents() {
Point2i rel = pos - last_mouse_pos;
+ if (mouse_mode == MOUSE_MODE_CAPTURED) {
+ pos = Point2i(current_videomode.width / 2, current_videomode.height / 2);
+ }
+
Ref<InputEventMouseMotion> mm;
mm.instance();
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 0eaeea9627..f56cc897ca 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -4174,7 +4174,7 @@ Control::CursorShape TextEdit::get_cursor_shape(const Point2 &p_pos) const {
}
}
- return CURSOR_IBEAM;
+ return get_default_cursor_shape();
}
void TextEdit::set_text(String p_text) {
@@ -6256,6 +6256,7 @@ TextEdit::TextEdit() {
breakpoint_gutter_width = 0;
cache.fold_gutter_width = 0;
fold_gutter_width = 0;
+ set_default_cursor_shape(CURSOR_IBEAM);
indent_size = 4;
text.set_indent_size(indent_size);