summaryrefslogtreecommitdiff
path: root/wx+/no_flicker.h
diff options
context:
space:
mode:
Diffstat (limited to 'wx+/no_flicker.h')
-rw-r--r--wx+/no_flicker.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/wx+/no_flicker.h b/wx+/no_flicker.h
index 9f91bbdb..8a461db3 100644
--- a/wx+/no_flicker.h
+++ b/wx+/no_flicker.h
@@ -22,7 +22,7 @@ namespace
void setText(wxTextCtrl& control, const wxString& newText, bool* additionalLayoutChange = nullptr)
{
const wxString& label = control.GetValue(); //perf: don't call twice!
- if (additionalLayoutChange && !*additionalLayoutChange) //never revert from true to false!
+ if (additionalLayoutChange && !*additionalLayoutChange && control.IsShown()) //never revert from true to false!
*additionalLayoutChange = label.length() != newText.length(); //avoid screen flicker: update layout only when necessary
if (label != newText)
@@ -36,7 +36,7 @@ void setText(wxStaticText& control, const wxString& newText, bool* additionalLay
//e.g. "filenames in the sync progress dialog": https://sourceforge.net/p/freefilesync/bugs/279/
const wxString& label = control.GetLabelText(); //perf: don't call twice!
- if (additionalLayoutChange && !*additionalLayoutChange)
+ if (additionalLayoutChange && !*additionalLayoutChange && control.IsShown()) //"better" or overkill(?): IsShownOnScreen()
*additionalLayoutChange = label.length() != newText.length(); //avoid screen flicker: update layout only when necessary
if (label != newText)
bgstack15