aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index f384476..7b81469 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -259,7 +259,7 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager_base &rm,
259 click_raises(rm, true, scrname+".clickRaises"), 259 click_raises(rm, true, scrname+".clickRaises"),
260 default_deco(rm, "NORMAL", scrname+".defaultDeco"), 260 default_deco(rm, "NORMAL", scrname+".defaultDeco"),
261 tab_placement(rm, FbWinFrame::TOPLEFT, scrname+".tab.placement"), 261 tab_placement(rm, FbWinFrame::TOPLEFT, scrname+".tab.placement"),
262 windowmenufile(rm, Fluxbox::instance()->getDefaultDataFilename("windowmenu"), scrname+".windowMenu"), 262 windowmenufile(rm, Fluxbox::instance()->getDefaultDataFilename("windowmenu2"), scrname+".windowMenu"),
263 typing_delay(rm, 0, scrname+".noFocusWhileTypingDelay"), 263 typing_delay(rm, 0, scrname+".noFocusWhileTypingDelay"),
264 workspaces(rm, 4, scrname+".workspaces"), 264 workspaces(rm, 4, scrname+".workspaces"),
265 edge_snap_threshold(rm, 10, scrname+".edgeSnapThreshold"), 265 edge_snap_threshold(rm, 10, scrname+".edgeSnapThreshold"),
@@ -1392,26 +1392,25 @@ void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id,
1392} 1392}
1393 1393
1394void BScreen::initMenus() { 1394void BScreen::initMenus() {
1395 lua::state &l = Fluxbox::instance()->lua();
1396 m_workspacemenu.reset(MenuCreator::createMenuType("workspacemenu", screenNumber())); 1395 m_workspacemenu.reset(MenuCreator::createMenuType("workspacemenu", screenNumber()));
1397 l.loadfile(FbTk::StringUtil::expandFilename(Fluxbox::instance()->getMenuFilename()).c_str()); 1396
1398 l.call(0, 0); 1397 m_rootmenu->reloadHelper()->setMainFile(Fluxbox::instance()->getMenuFilename());
1399 l.getglobal("menu");
1400 m_rootmenu = MenuCreator::createMenu(l, 0);
1401// m_rootmenu->reloadHelper()->setMainFile(Fluxbox::instance()->getMenuFilename());
1402 m_windowmenu->reloadHelper()->setMainFile(windowMenuFilename()); 1398 m_windowmenu->reloadHelper()->setMainFile(windowMenuFilename());
1403} 1399}
1404 1400
1405 1401
1406void BScreen::rereadMenu() { 1402void BScreen::rereadMenu() {
1407 1403
1408 m_rootmenu->removeAll();
1409 m_rootmenu->setLabel(FbTk::BiDiString(""));
1410
1411 Fluxbox * const fb = Fluxbox::instance(); 1404 Fluxbox * const fb = Fluxbox::instance();
1412 if (!fb->getMenuFilename().empty()) 1405 lua::state &l = fb->lua();
1413 MenuCreator::createFromFile(fb->getMenuFilename(), *m_rootmenu, 1406 l.checkstack(1);
1414 m_rootmenu->reloadHelper()); 1407 lua::stack_sentry s(l);
1408
1409 // XXX try/catch
1410 m_rootmenu->removeAll();
1411 l.loadfile(FbTk::StringUtil::expandFilename(fb->getMenuFilename()).c_str());
1412 l.call(0, 1);
1413 MenuCreator::createMenu(*m_rootmenu, l, screenNumber(), m_rootmenu->reloadHelper());
1415 1414
1416 if (m_rootmenu->numberOfItems() == 0) { 1415 if (m_rootmenu->numberOfItems() == 0) {
1417 _FB_USES_NLS; 1416 _FB_USES_NLS;
@@ -1438,12 +1437,16 @@ const std::string BScreen::windowMenuFilename() const {
1438} 1437}
1439 1438
1440void BScreen::rereadWindowMenu() { 1439void BScreen::rereadWindowMenu() {
1440 lua::state &l = Fluxbox::instance()->lua();
1441 l.checkstack(1);
1442 lua::stack_sentry s(l);
1441 1443
1442 m_windowmenu->removeAll();
1443 if (!windowMenuFilename().empty())
1444 MenuCreator::createFromFile(windowMenuFilename(), *m_windowmenu,
1445 m_windowmenu->reloadHelper());
1446 1444
1445 // XXX try/catch
1446 m_windowmenu->removeAll();
1447 l.loadfile(FbTk::StringUtil::expandFilename(windowMenuFilename()).c_str());
1448 l.call(0, 1);
1449 MenuCreator::createMenu(*m_windowmenu, l, screenNumber(), m_windowmenu->reloadHelper());
1447} 1450}
1448 1451
1449void BScreen::addConfigMenu(const FbTk::FbString &label, FbTk::Menu &menu) { 1452void BScreen::addConfigMenu(const FbTk::FbString &label, FbTk::Menu &menu) {