From 75850d8b604b8d35350f7eb535213eecf10beefc Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Tue, 19 Aug 2008 09:36:08 -0700 Subject: shift+enter wasn't sending right click if the menu item had a submenu --- src/FbTk/Menu.cc | 6 +++--- src/WorkspaceMenu.cc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index 4bdc597..ce751d9 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc @@ -1058,11 +1058,11 @@ void Menu::keyPressEvent(XKeyEvent &event) { resetTypeAhead(); if (validIndex(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(); else { - // send fake button click - int button = (event.state & ShiftMask) ? 3 : 1; find(m_active_index)->click(button, event.time, event.state); m_need_update = true; updateMenu(); diff --git a/src/WorkspaceMenu.cc b/src/WorkspaceMenu.cc index 5a83170..3bef2b6 100644 --- a/src/WorkspaceMenu.cc +++ b/src/WorkspaceMenu.cc @@ -125,7 +125,7 @@ void WorkspaceMenu::init(BScreen &screen) { wkspc->name().c_str(), &wkspc->menu()); FbTk::RefCount > 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); } setItemSelected(screen.currentWorkspace()->workspaceID() + IDX_AFTER_ICONS, true); -- cgit v0.11.2