diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-07-18 10:44:01 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2013-02-18 21:04:23 (GMT) |
commit | d62a0183c99f829620997545e5fc31f8d1714b59 (patch) | |
tree | 87b6feaf8fa1806e35c0ab7adebddf0216101c62 /src | |
parent | 7a53811fa7b42cf9751ace862dd712d29690da84 (diff) | |
download | fluxbox_pavel-d62a0183c99f829620997545e5fc31f8d1714b59.zip fluxbox_pavel-d62a0183c99f829620997545e5fc31f8d1714b59.tar.bz2 |
Attach modifiedSig handlers to the session.screenX.windowMenu resource
Diffstat (limited to 'src')
-rw-r--r-- | src/Screen.cc | 15 | ||||
-rw-r--r-- | src/Screen.hh | 1 |
2 files changed, 4 insertions, 12 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index 931b356..8f1fcef 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -849,9 +849,6 @@ void BScreen::reconfigure() { | |||
849 | for(size_t i = 0; i < std::min(m_workspaces_list.size(), resource.workspace_names->size()); ++i) | 849 | for(size_t i = 0; i < std::min(m_workspaces_list.size(), resource.workspace_names->size()); ++i) |
850 | m_workspaces_list[i]->setName( resource.workspace_names.get()[i] ); | 850 | m_workspaces_list[i]->setName( resource.workspace_names.get()[i] ); |
851 | 851 | ||
852 | // update menu filenames | ||
853 | m_windowmenu->reloadHelper()->setMainFile(windowMenuFilename()); | ||
854 | |||
855 | // reconfigure workspaces | 852 | // reconfigure workspaces |
856 | for_each(m_workspaces_list.begin(), | 853 | for_each(m_workspaces_list.begin(), |
857 | m_workspaces_list.end(), | 854 | m_workspaces_list.end(), |
@@ -1366,7 +1363,9 @@ void BScreen::initMenus() { | |||
1366 | MemFun(*m_rootmenu->reloadHelper(), &FbTk::AutoReloadHelper::setMainFile)); | 1363 | MemFun(*m_rootmenu->reloadHelper(), &FbTk::AutoReloadHelper::setMainFile)); |
1367 | m_rootmenu->reloadHelper()->setMainFile(*Fluxbox::instance()->getMenuResource()); | 1364 | m_rootmenu->reloadHelper()->setMainFile(*Fluxbox::instance()->getMenuResource()); |
1368 | 1365 | ||
1369 | m_windowmenu->reloadHelper()->setMainFile(windowMenuFilename()); | 1366 | m_tracker.join(resource.windowmenufile.modifiedSig(), |
1367 | MemFun(*m_windowmenu->reloadHelper(), &FbTk::AutoReloadHelper::setMainFile)); | ||
1368 | m_windowmenu->reloadHelper()->setMainFile(*resource.windowmenufile); | ||
1370 | } | 1369 | } |
1371 | 1370 | ||
1372 | 1371 | ||
@@ -1410,12 +1409,6 @@ void BScreen::rereadMenu() { | |||
1410 | 1409 | ||
1411 | } | 1410 | } |
1412 | 1411 | ||
1413 | const std::string BScreen::windowMenuFilename() const { | ||
1414 | if ((*resource.windowmenufile).empty()) | ||
1415 | return Fluxbox::instance()->getDefaultDataFilename("windowmenu"); | ||
1416 | return *resource.windowmenufile; | ||
1417 | } | ||
1418 | |||
1419 | void BScreen::rereadWindowMenu() { | 1412 | void BScreen::rereadWindowMenu() { |
1420 | lua::state &l = Fluxbox::instance()->lua(); | 1413 | lua::state &l = Fluxbox::instance()->lua(); |
1421 | l.checkstack(1); | 1414 | l.checkstack(1); |
@@ -1423,7 +1416,7 @@ void BScreen::rereadWindowMenu() { | |||
1423 | 1416 | ||
1424 | m_windowmenu->removeAll(); | 1417 | m_windowmenu->removeAll(); |
1425 | try { | 1418 | try { |
1426 | l.loadfile(FbTk::StringUtil::expandFilename(windowMenuFilename()).c_str()); | 1419 | l.loadfile(FbTk::StringUtil::expandFilename(resource.windowmenufile).c_str()); |
1427 | l.call(0, 1); | 1420 | l.call(0, 1); |
1428 | MenuCreator::createMenu(*m_windowmenu, l, m_windowmenu->reloadHelper()); | 1421 | MenuCreator::createMenu(*m_windowmenu, l, m_windowmenu->reloadHelper()); |
1429 | } | 1422 | } |
diff --git a/src/Screen.hh b/src/Screen.hh index 2ff87db..3b54815 100644 --- a/src/Screen.hh +++ b/src/Screen.hh | |||
@@ -109,7 +109,6 @@ public: | |||
109 | bool getMaxDisableResize() const { return *resource.max_disable_resize; } | 109 | bool getMaxDisableResize() const { return *resource.max_disable_resize; } |
110 | bool doShowWindowPos() const { return *resource.show_window_pos; } | 110 | bool doShowWindowPos() const { return *resource.show_window_pos; } |
111 | FbTk::StringResource &defaultDecoResource() { return resource.default_deco; } | 111 | FbTk::StringResource &defaultDecoResource() { return resource.default_deco; } |
112 | const std::string windowMenuFilename() const; | ||
113 | FbTk::ImageControl &imageControl() { return *m_image_control.get(); } | 112 | FbTk::ImageControl &imageControl() { return *m_image_control.get(); } |
114 | // menus | 113 | // menus |
115 | const FbMenu &rootMenu() const { return *m_rootmenu.get(); } | 114 | const FbMenu &rootMenu() const { return *m_rootmenu.get(); } |