File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -59,12 +59,19 @@ const wchar_t* LangBarButton::text() const {
5959}
6060
6161void LangBarButton::setText (const wchar_t * text) {
62- if (text) {
62+ if (text && text[ 0 ] != ' \0 ' ) {
6363 wcsncpy (info_.szDescription , text, TF_LBI_DESC_MAXLEN - 1 );
6464 info_.szDescription [TF_LBI_DESC_MAXLEN - 1 ] = 0 ;
6565 }
66- else
67- *info_.szDescription = 0 ;
66+ else {
67+ // NOTE: The language button text should NOT be empty.
68+ // Otherwise, when the button status or icon is changed after its creation,
69+ // the button will disappear temporarily in Windows 10 for unknown reason.
70+ // This can be considered a bug of Windows 10 and there does not seem to be a way to fix it.
71+ // So we need to avoid empty button text otherwise the language button won't work properly.
72+ // Here we use a space character to make the text non-empty to workaround the problem.
73+ wcscpy (info_.szDescription , L" " );
74+ }
6875 update (TF_LBI_TEXT);
6976}
7077
You can’t perform that action at this time.
0 commit comments