+ const int curSelection = combo->GetCurrentSelection();
+
+ const bool hasChanged = curSelection != g_SelectionBeforePopup;
+
+ // reset the selection flag to value meaning that it is hidden and do it
+ // now, before generating the events, so that GetSelection() returns the
+ // new value from the event handler
+ g_SelectionBeforePopup = wxID_NONE;
+
+ if ( hasChanged )