aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-05-30 09:02:41 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-05-30 09:02:41 (GMT)
commit85a44db6c60fd70d968ee79696e4d06aa359e4bf (patch)
tree638e324de38de06bd111035c1fc86aca0d69e3dd /src/FbTk
parent5119ded37434bbc94f0d3c663f0d670f37438583 (diff)
downloadfluxbox-85a44db6c60fd70d968ee79696e4d06aa359e4bf.zip
fluxbox-85a44db6c60fd70d968ee79696e4d06aa359e4bf.tar.bz2
reset typeahead when adding/removing items in the menu
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/Menu.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
index 4b73b41..ec60b24 100644
--- a/src/FbTk/Menu.cc
+++ b/src/FbTk/Menu.cc
@@ -243,6 +243,8 @@ int Menu::remove(unsigned int index) {
243 MenuItem *item = (*it); 243 MenuItem *item = (*it);
244 244
245 if (item) { 245 if (item) {
246 if (!m_matches.empty())
247 resetTypeAhead();
246 menuitems.erase(it); 248 menuitems.erase(it);
247 // avoid O(n^2) algorithm with removeAll() 249 // avoid O(n^2) algorithm with removeAll()
248 if (index != menuitems.size()) 250 if (index != menuitems.size())
@@ -511,6 +513,7 @@ void Menu::show() {
511 updateMenu(); 513 updateMenu();
512 514
513 m_type_ahead.reset(); 515 m_type_ahead.reset();
516 m_matches.clear();
514 517
515 menu.window.showSubwindows(); 518 menu.window.showSubwindows();
516 menu.window.show(); 519 menu.window.show();