Fix bug where on wxGTK the display mode would get set to "Subs Only" the first time the menus were opened after opening video or audio

Originally committed to SVN as r6208.
This commit is contained in:
Thomas Goyne 2012-01-08 01:04:55 +00:00
parent 89705b4f9c
commit 25c1225ad1

View file

@ -154,8 +154,13 @@ class CommandManager {
UpdateItemName(item);
if (flags & cmd::COMMAND_VALIDATE)
item.second->Enable(item.first->Validate(context));
if (flags & cmd::COMMAND_RADIO || flags & cmd::COMMAND_TOGGLE)
item.second->Check(item.first->IsActive(context));
if (flags & cmd::COMMAND_RADIO || flags & cmd::COMMAND_TOGGLE) {
bool check = item.first->IsActive(context);
// Don't call Check(false) on radio items as this causes wxGtk to
// send a menu clicked event, and it should be a no-op anyway
if (check || flags & cmd::COMMAND_TOGGLE)
item.second->Check(check);
}
}
void UpdateItemName(std::pair<cmd::Command*, wxMenuItem*> const& item) {