From 7b036a94bf9af558dab35a56a9c0b6dd8bae105b 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 --- 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 f7d74b2b492..eecc730f5c2 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -853,7 +853,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 f1a2823e8f6..9b3b047712b 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -3458,7 +3458,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(); } }