aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-07-18 10:44:01 (GMT)
committerPavel Labath <pavelo@centrum.sk>2011-11-01 09:57:22 (GMT)
commite869b52fe6963357f95e19c3e3fbd742ef8a48bd (patch)
treee1babe7dd9c49b35325777bb054ee6e906a121e2 /src
parent84a118a9c9b3094cf0cd05f6d748bc49646e83f7 (diff)
downloadfluxbox_pavel-e869b52fe6963357f95e19c3e3fbd742ef8a48bd.zip
fluxbox_pavel-e869b52fe6963357f95e19c3e3fbd742ef8a48bd.tar.bz2
Attach modifiedSig handlers to the session.screenX.windowMenu resource
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc15
-rw-r--r--src/Screen.hh1
2 files changed, 4 insertions, 12 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 82a4939..c883202 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -826,9 +826,6 @@ void BScreen::reconfigure() {
826 for(size_t i = 0; i < std::min(m_workspaces_list.size(), resource.workspace_names->size()); ++i) 826 for(size_t i = 0; i < std::min(m_workspaces_list.size(), resource.workspace_names->size()); ++i)
827 m_workspaces_list[i]->setName( resource.workspace_names.get()[i] ); 827 m_workspaces_list[i]->setName( resource.workspace_names.get()[i] );
828 828
829 // update menu filenames
830 m_windowmenu->reloadHelper()->setMainFile(windowMenuFilename());
831
832 // reconfigure workspaces 829 // reconfigure workspaces
833 for_each(m_workspaces_list.begin(), 830 for_each(m_workspaces_list.begin(),
834 m_workspaces_list.end(), 831 m_workspaces_list.end(),
@@ -1347,7 +1344,9 @@ void BScreen::initMenus() {
1347 MemFun(*m_rootmenu->reloadHelper(), &FbTk::AutoReloadHelper::setMainFile)); 1344 MemFun(*m_rootmenu->reloadHelper(), &FbTk::AutoReloadHelper::setMainFile));
1348 m_rootmenu->reloadHelper()->setMainFile(*Fluxbox::instance()->getMenuResource()); 1345 m_rootmenu->reloadHelper()->setMainFile(*Fluxbox::instance()->getMenuResource());
1349 1346
1350 m_windowmenu->reloadHelper()->setMainFile(windowMenuFilename()); 1347 m_tracker.join(resource.windowmenufile.modifiedSig(),
1348 MemFun(*m_windowmenu->reloadHelper(), &FbTk::AutoReloadHelper::setMainFile));
1349 m_windowmenu->reloadHelper()->setMainFile(*resource.windowmenufile);
1351} 1350}
1352 1351
1353 1352
@@ -1390,12 +1389,6 @@ void BScreen::rereadMenu() {
1390 1389
1391} 1390}
1392 1391
1393const std::string BScreen::windowMenuFilename() const {
1394 if ((*resource.windowmenufile).empty())
1395 return Fluxbox::instance()->getDefaultDataFilename("windowmenu");
1396 return *resource.windowmenufile;
1397}
1398
1399void BScreen::rereadWindowMenu() { 1392void BScreen::rereadWindowMenu() {
1400 lua::state &l = Fluxbox::instance()->lua(); 1393 lua::state &l = Fluxbox::instance()->lua();
1401 l.checkstack(1); 1394 l.checkstack(1);
@@ -1403,7 +1396,7 @@ void BScreen::rereadWindowMenu() {
1403 1396
1404 m_windowmenu->removeAll(); 1397 m_windowmenu->removeAll();
1405 try { 1398 try {
1406 l.loadfile(FbTk::StringUtil::expandFilename(windowMenuFilename()).c_str()); 1399 l.loadfile(FbTk::StringUtil::expandFilename(resource.windowmenufile).c_str());
1407 l.call(0, 1); 1400 l.call(0, 1);
1408 MenuCreator::createMenu(*m_windowmenu, l, m_windowmenu->reloadHelper()); 1401 MenuCreator::createMenu(*m_windowmenu, l, m_windowmenu->reloadHelper());
1409 } 1402 }
diff --git a/src/Screen.hh b/src/Screen.hh
index ba2d6ea..0f5ee80 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -108,7 +108,6 @@ public:
108 bool getMaxDisableResize() const { return *resource.max_disable_resize; } 108 bool getMaxDisableResize() const { return *resource.max_disable_resize; }
109 bool doShowWindowPos() const { return *resource.show_window_pos; } 109 bool doShowWindowPos() const { return *resource.show_window_pos; }
110 FbTk::StringResource &defaultDecoResource() { return resource.default_deco; } 110 FbTk::StringResource &defaultDecoResource() { return resource.default_deco; }
111 const std::string windowMenuFilename() const;
112 FbTk::ImageControl &imageControl() { return *m_image_control.get(); } 111 FbTk::ImageControl &imageControl() { return *m_image_control.get(); }
113 // menus 112 // menus
114 const FbMenu &rootMenu() const { return *m_rootmenu.get(); } 113 const FbMenu &rootMenu() const { return *m_rootmenu.get(); }