From 9e1e5daddf41d00330a61b0a485237ff511b255f Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Sun, 6 Nov 2016 14:15:59 +0000 Subject: [PATCH] Caret blink will no longer cause redraw without focus, issue 6167 (cherry picked from commit 7b036a94bf9af558dab35a56a9c0b6dd8bae105b) --- scene/gui/line_edit.cpp | 2 +- scene/gui/text_edit.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index caac2c10771..a69b92465b1 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -859,7 +859,7 @@ void LineEdit::_reset_caret_blink_timer() { void LineEdit::_toggle_draw_caret() { draw_caret = !draw_caret; - if (is_visible()) { + if (is_visible() && has_focus() && window_has_focus) { update(); } } diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 24633a7cd18..18725734702 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -3350,7 +3350,7 @@ void TextEdit::_reset_caret_blink_timer() { void TextEdit::_toggle_draw_caret() { draw_caret = !draw_caret; - if (is_visible()) { + if (is_visible() && has_focus() && window_has_focus) { update(); } }