From 25c1225ad17ec7d046a5d32ad8cd6efaf80bdfad Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 8 Jan 2012 01:04:55 +0000 Subject: [PATCH] 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. --- aegisub/src/menu.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/aegisub/src/menu.cpp b/aegisub/src/menu.cpp index 14f72d603..8bf9eca60 100644 --- a/aegisub/src/menu.cpp +++ b/aegisub/src/menu.cpp @@ -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 const& item) {