save workspace names, and some fixes for menu behavior
markt markt
6 files changed,
32 insertions(+),
9 deletions(-)
M
ChangeLog
→
ChangeLog
@@ -1,5 +1,12 @@
(Format: Year/Month/Day) Changes for 1.0.0: +*07/07/07: + * Right clicking on a submenu didn't revert focus to its parent (Mark) + FbTk/Menu.cc/hh + * Pressing escape in a torn menu didn't work (Mark) + FbTk/Menu.cc + * Save workspace names when changing through menu, bug #1748967 (Mark) + Workspace.cc Screen.cc/hh *07/07/06: * When saving window information, use the class name instead of instance name by default (Mark)
M
src/FbTk/Menu.cc
→
src/FbTk/Menu.cc
@@ -358,9 +358,6 @@ }
void Menu::enterParent() { internal_hide(); - // return focus to parent - if (parent()) - parent()->grabInputFocus(); } void Menu::disableTitle() {@@ -583,11 +580,11 @@ }
} -void Menu::internal_hide() { +void Menu::internal_hide(bool first) { if (validIndex(m_which_sub)) { MenuItem *tmp = menuitems[m_which_sub]; - tmp->submenu()->internal_hide(); + tmp->submenu()->internal_hide(false); } // if we have an active index we need to redraw it@@ -596,11 +593,19 @@ int old = m_active_index;
m_active_index = -1; clearItem(old); // clear old area from highlight - if (shown && shown->menu.window == menu.window) - shown = (Menu *) 0; + if (shown && shown->menu.window == menu.window) { + if (m_parent && m_parent->isVisible()) + shown = m_parent; + else + shown = (Menu *) 0; + } m_torn = m_visible = false; m_which_sub = -1; + + if (first && m_parent && m_parent->isVisible() && + s_focused && !s_focused->isVisible()) + m_parent->grabInputFocus(); menu.window.hide(); }@@ -1031,6 +1036,7 @@ enterSubmenu();
break; case XK_Escape: // close menu m_type_ahead.reset(); + m_torn = false; hide(); break; case XK_BackSpace:
M
src/FbTk/Menu.hh
→
src/FbTk/Menu.hh
@@ -191,7 +191,7 @@ void highlightItem(int index);
virtual void redrawTitle(FbDrawable &pm); virtual void redrawFrame(FbDrawable &pm); - virtual void internal_hide(); + virtual void internal_hide(bool first = true); void update(FbTk::Subject *);
M
src/Screen.cc
→
src/Screen.cc
@@ -1036,6 +1036,14 @@ initMenu();
m_rootmenu->reconfigure(); } +void BScreen::updateWorkspaceName(unsigned int w) { + Workspace *space = getWorkspace(w); + if (space) { + m_workspace_names[w] = space->name(); + updateWorkspaceNamesAtom(); + Fluxbox::instance()->save_rc(); + } +} void BScreen::removeWorkspaceNames() { m_workspace_names.clear();
M
src/Screen.hh
→
src/Screen.hh
@@ -347,6 +347,8 @@ * @param delta number of steps to jump
*/ void leftWorkspace(int delta); + /// update workspace name for given workspace + void updateWorkspaceName(unsigned int w); /// remove all workspace names void removeWorkspaceNames(); /// update the workspace name atom
M
src/Workspace.cc
→
src/Workspace.cc
@@ -382,7 +382,7 @@ m_id + 1); //m_id starts at 0
m_name = tname; } - screen().updateWorkspaceNamesAtom(); + screen().updateWorkspaceName(m_id); menu().setLabel(m_name); menu().updateMenu();