aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormarkt <markt>2007-01-15 18:53:45 (GMT)
committermarkt <markt>2007-01-15 18:53:45 (GMT)
commit2a9e8e27826f57068c32c159c9b5a16824dd04b1 (patch)
treee98ee534def9baf245f4f6bd056b7008bf6c6107 /src
parentdb0b1fadb82381c42ad4498f795c186cdb94c518 (diff)
downloadfluxbox_paul-2a9e8e27826f57068c32c159c9b5a16824dd04b1.zip
fluxbox_paul-2a9e8e27826f57068c32c159c9b5a16824dd04b1.tar.bz2
fix rootmenu disappearing on reconfigure -- I can't tell that the code I
removed here did anything useful; it's probably a remnant of an old menu implementation
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc52
1 files changed, 9 insertions, 43 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 252df9c..ab1d718 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -862,6 +862,15 @@ void BScreen::reconfigure() {
862 } 862 }
863 } 863 }
864 864
865 // if timestamp hasn't changed, then just a reconfigure is fine
866 // and that seems to happen somewhere else, anyway
867 if (fluxbox->menuTimestampsChanged()) {
868 // all bets are off, so just hide the menu and reset the filenames
869 fluxbox->clearMenuFilenames();
870 m_rootmenu->hide();
871 rereadMenu();
872 }
873
865 //reconfigure menus 874 //reconfigure menus
866 m_workspacemenu->reconfigure(); 875 m_workspacemenu->reconfigure();
867 m_configmenu->reconfigure(); 876 m_configmenu->reconfigure();
@@ -869,49 +878,6 @@ void BScreen::reconfigure() {
869 m_windowmenu.reset(MenuCreator::createMenuType("windowmenu", screenNumber())); 878 m_windowmenu.reset(MenuCreator::createMenuType("windowmenu", screenNumber()));
870 m_windowmenu->setInternalMenu(); 879 m_windowmenu->setInternalMenu();
871 880
872 // We need to check to see if the timestamps
873 // changed before we actually can restore the menus
874 // in the same way, since we can't really say if
875 // any submenu is in the same place as before if the
876 // menu changed.
877
878 // if timestamp changed then no restoring
879 bool restore_menus = ! fluxbox->menuTimestampsChanged();
880
881 // destroy old timestamps
882 fluxbox->clearMenuFilenames();
883
884 // save submenu index so we can restore them afterwards
885 vector<int> remember_sub;
886 if (restore_menus) {
887 FbTk::Menu *menu = m_rootmenu.get();
888 while (menu) {
889 int r = menu->currentSubmenu();
890 if (r < 0) break;
891 remember_sub.push_back(r);
892 menu = menu->find(r)->submenu();
893 }
894 }
895
896 rereadMenu();
897
898 if (restore_menus) {
899 // restore submenus, no timestamp changed
900 FbTk::Menu *menu = m_rootmenu.get();
901 for (size_t i = 0; i < remember_sub.size(); i++ ) {
902 int sub = remember_sub[i];
903 if (!menu || sub < 0)
904 break;
905 FbTk::MenuItem *item = menu->find(sub);
906 if (item != 0) {
907 menu->drawSubmenu(sub);
908 menu = item->submenu();
909 } else
910 menu = 0;
911
912 }
913 }
914
915 // reconfigure workspaces 881 // reconfigure workspaces
916 for_each(m_workspaces_list.begin(), 882 for_each(m_workspaces_list.begin(),
917 m_workspaces_list.end(), 883 m_workspaces_list.end(),