shift+enter wasn't sending right click if the menu item had a submenu

This commit is contained in:
Mark Tiefenbruck 2008-08-19 09:36:08 -07:00
parent 4e64d45e16
commit 75850d8b60
2 changed files with 4 additions and 4 deletions

View file

@ -1058,11 +1058,11 @@ void Menu::keyPressEvent(XKeyEvent &event) {
resetTypeAhead(); resetTypeAhead();
if (validIndex(m_active_index) && if (validIndex(m_active_index) &&
isItemEnabled(m_active_index)) { isItemEnabled(m_active_index)) {
if (menuitems[m_active_index]->submenu() != 0) // send fake button click
int button = (event.state & ShiftMask) ? 3 : 1;
if (menuitems[m_active_index]->submenu() != 0 && button == 1)
enterSubmenu(); enterSubmenu();
else { else {
// send fake button click
int button = (event.state & ShiftMask) ? 3 : 1;
find(m_active_index)->click(button, event.time, event.state); find(m_active_index)->click(button, event.time, event.state);
m_need_update = true; m_need_update = true;
updateMenu(); updateMenu();

View file

@ -125,7 +125,7 @@ void WorkspaceMenu::init(BScreen &screen) {
wkspc->name().c_str(), wkspc->name().c_str(),
&wkspc->menu()); &wkspc->menu());
FbTk::RefCount<FbTk::Command<void> > jump_cmd(new JumpToWorkspaceCmd(wkspc->workspaceID())); FbTk::RefCount<FbTk::Command<void> > jump_cmd(new JumpToWorkspaceCmd(wkspc->workspaceID()));
mb_menu->setCommand(2, jump_cmd); mb_menu->setCommand(3, jump_cmd);
insert(mb_menu, workspace + IDX_AFTER_ICONS); insert(mb_menu, workspace + IDX_AFTER_ICONS);
} }
setItemSelected(screen.currentWorkspace()->workspaceID() + IDX_AFTER_ICONS, true); setItemSelected(screen.currentWorkspace()->workspaceID() + IDX_AFTER_ICONS, true);