summaryrefslogtreecommitdiff
path: root/wx+/no_flicker.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-06-20 07:46:53 -0400
committerB. Stack <bgstack15@gmail.com>2023-06-20 07:46:53 -0400
commitf76994f1fb3e25c4563c9d8afce6bbc86701d1d2 (patch)
treeb39389163603195a0169af57712eb0765e5c11f4 /wx+/no_flicker.h
parentadd upstream 12.3 (diff)
downloadFreeFileSync-f76994f1fb3e25c4563c9d8afce6bbc86701d1d2.tar.gz
FreeFileSync-f76994f1fb3e25c4563c9d8afce6bbc86701d1d2.tar.bz2
FreeFileSync-f76994f1fb3e25c4563c9d8afce6bbc86701d1d2.zip
add upstream 12.412.4
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