Skip to content

Commit 44a52af

Browse files
committed
Merge pull request nwjs#407 from zhchbin/master
[WIN] Update status of menuitems in the menu bar.
2 parents f2ea468 + 43367b0 commit 44a52af

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/api/menu/menu_win.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ void Menu::Rebuild(const gfx::NativeMenu *parent_menu) {
144144
if (is_menu_modified_) {
145145
// Refresh menu before show.
146146
menu_->Rebuild();
147+
menu_->UpdateStates();
147148
for (size_t index = 0; index < icon_bitmaps_.size(); ++index) {
148149
::DeleteObject(icon_bitmaps_[index]);
149150
}

src/browser/native_window_win.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,10 @@ bool NativeWindowWin::ExecuteWindowsCommand(int command_id) {
589589
}
590590

591591
bool NativeWindowWin::ExecuteAppCommand(int command_id) {
592-
if (menu_)
592+
if (menu_) {
593593
menu_->menu_delegate_->ExecuteCommand(command_id);
594+
menu_->menu_->UpdateStates();
595+
}
594596

595597
return false;
596598
}

0 commit comments

Comments
 (0)