diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-06 16:33:43 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-06 16:33:43 +0300 |
commit | 2fe8add6000b6a31659f2fd24900a25743503655 (patch) | |
tree | 27ab4f5732d9068c73fa2afe30106e07147823ea | |
parent | e7df64724afc9a1fba553ed2db926fed263ff6e2 (diff) |
fix for stupid bug in Windows: m_accList.OnSelChange is called twice recursively even if the list position isn't changed
-rw-r--r-- | src/mir_app/src/proto_opts.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp index 178391d408..1ded064a65 100644 --- a/src/mir_app/src/proto_opts.cpp +++ b/src/mir_app/src/proto_opts.cpp @@ -158,7 +158,7 @@ class CAccountManagerDlg : public CDlgBase HFONT m_hfntTitle, m_hfntText;
int m_titleHeight, m_textHeight;
int m_selectedHeight, m_normalHeight;
- int m_iSelected;
+ int m_iSelected, m_iPrevSel = -1;
CAccountListCtrl m_accList;
CCtrlHyperlink m_link;
@@ -425,8 +425,13 @@ public: void OnListSelChange(void*)
{
+ int iSel = m_accList.GetCurSel();
+ if (iSel == m_iPrevSel)
+ return;
+
+ m_iPrevSel = iSel;
UpdateAccountInfo();
- SelectItem(m_accList.GetCurSel());
+ SelectItem(iSel);
::SetFocus(m_accList.GetHwnd());
}
|