diff options
author | Mathias Gumz <akira at fluxbox dot org> | 2008-08-14 05:52:39 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2008-08-14 05:52:39 (GMT) |
commit | e169d33552c8e7070aa6e13da0187f2013b4cfc3 (patch) | |
tree | ae9e92c7e885791c7f47645184070cbcd441ab94 /src/Screen.cc | |
parent | c82e7c0080f8a5c14dcf95ec92dc42f59ea9dd8b (diff) | |
parent | 91ca3bc5c8e2b892a9a81b18246f72aba7deebfd (diff) | |
download | fluxbox-e169d33552c8e7070aa6e13da0187f2013b4cfc3.zip fluxbox-e169d33552c8e7070aa6e13da0187f2013b4cfc3.tar.bz2 |
Merge branch 'master' into to_push
Diffstat (limited to 'src/Screen.cc')
-rw-r--r-- | src/Screen.cc | 158 |
1 files changed, 82 insertions, 76 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index bf5a625..838a313 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -38,6 +38,7 @@ | |||
38 | #include "FbTk/BoolMenuItem.hh" | 38 | #include "FbTk/BoolMenuItem.hh" |
39 | #include "FbTk/IntMenuItem.hh" | 39 | #include "FbTk/IntMenuItem.hh" |
40 | #include "FocusModelMenuItem.hh" | 40 | #include "FocusModelMenuItem.hh" |
41 | #include "RadioMenuItem.hh" | ||
41 | 42 | ||
42 | // menus | 43 | // menus |
43 | #include "FbMenu.hh" | 44 | #include "FbMenu.hh" |
@@ -174,21 +175,21 @@ int anotherWMRunning(Display *display, XErrorEvent *) { | |||
174 | } | 175 | } |
175 | 176 | ||
176 | 177 | ||
177 | class TabPlacementMenuItem: public FbTk::MenuItem { | 178 | class TabPlacementMenuItem: public FbTk::RadioMenuItem { |
178 | public: | 179 | public: |
179 | TabPlacementMenuItem(FbTk::FbString & label, BScreen &screen, | 180 | TabPlacementMenuItem(FbTk::FbString & label, BScreen &screen, |
180 | FbWinFrame::TabPlacement place, | 181 | FbWinFrame::TabPlacement place, |
181 | FbTk::RefCount<FbTk::Command<void> > &cmd): | 182 | FbTk::RefCount<FbTk::Command<void> > &cmd): |
182 | FbTk::MenuItem(label, cmd), | 183 | FbTk::RadioMenuItem(label, cmd), |
183 | m_screen(screen), | 184 | m_screen(screen), |
184 | m_place(place) { | 185 | m_place(place) { |
185 | setCloseOnClick(false); | 186 | setCloseOnClick(false); |
186 | } | 187 | } |
187 | 188 | ||
188 | bool isEnabled() const { return m_screen.getTabPlacement() != m_place; } | 189 | bool isSelected() const { return m_screen.getTabPlacement() == m_place; } |
189 | void click(int button, int time, unsigned int mods) { | 190 | void click(int button, int time, unsigned int mods) { |
190 | m_screen.saveTabPlacement(m_place); | 191 | m_screen.saveTabPlacement(m_place); |
191 | FbTk::MenuItem::click(button, time, mods); | 192 | FbTk::RadioMenuItem::click(button, time, mods); |
192 | } | 193 | } |
193 | 194 | ||
194 | 195 | ||
@@ -264,7 +265,6 @@ getString() const { | |||
264 | BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm, | 265 | BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm, |
265 | const string &scrname, | 266 | const string &scrname, |
266 | const string &altscrname): | 267 | const string &altscrname): |
267 | image_dither(rm, false, scrname+".imageDither", altscrname+".ImageDither"), | ||
268 | opaque_move(rm, false, scrname + ".opaqueMove", altscrname+".OpaqueMove"), | 268 | opaque_move(rm, false, scrname + ".opaqueMove", altscrname+".OpaqueMove"), |
269 | full_max(rm, false, scrname+".fullMaximization", altscrname+".FullMaximization"), | 269 | full_max(rm, false, scrname+".fullMaximization", altscrname+".FullMaximization"), |
270 | max_ignore_inc(rm, true, scrname+".maxIgnoreIncrement", altscrname+".MaxIgnoreIncrement"), | 270 | max_ignore_inc(rm, true, scrname+".maxIgnoreIncrement", altscrname+".MaxIgnoreIncrement"), |
@@ -278,18 +278,19 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm, | |||
278 | default_deco(rm, "NORMAL", scrname+".defaultDeco", altscrname+".DefaultDeco"), | 278 | default_deco(rm, "NORMAL", scrname+".defaultDeco", altscrname+".DefaultDeco"), |
279 | rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"), | 279 | rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"), |
280 | tab_placement(rm, FbWinFrame::TOPLEFT, scrname+".tab.placement", altscrname+".Tab.Placement"), | 280 | tab_placement(rm, FbWinFrame::TOPLEFT, scrname+".tab.placement", altscrname+".Tab.Placement"), |
281 | windowmenufile(rm, "", scrname+".windowMenu", altscrname+".WindowMenu"), | 281 | windowmenufile(rm, Fluxbox::instance()->getDefaultDataFilename("windowmenu"), scrname+".windowMenu", altscrname+".WindowMenu"), |
282 | typing_delay(rm, 0, scrname+".noFocusWhileTypingDelay", altscrname+".NoFocusWhileTypingDelay"), | 282 | typing_delay(rm, 0, scrname+".noFocusWhileTypingDelay", altscrname+".NoFocusWhileTypingDelay"), |
283 | follow_model(rm, IGNORE_OTHER_WORKSPACES, scrname+".followModel", altscrname+".followModel"), | 283 | follow_model(rm, IGNORE_OTHER_WORKSPACES, scrname+".followModel", altscrname+".followModel"), |
284 | user_follow_model(rm, FOLLOW_ACTIVE_WINDOW, scrname+".userFollowModel", altscrname+".UserFollowModel"), | 284 | user_follow_model(rm, FOLLOW_ACTIVE_WINDOW, scrname+".userFollowModel", altscrname+".UserFollowModel"), |
285 | workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"), | 285 | workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"), |
286 | edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"), | 286 | edge_snap_threshold(rm, 10, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"), |
287 | focused_alpha(rm, 255, scrname+".window.focus.alpha", altscrname+".Window.Focus.Alpha"), | 287 | focused_alpha(rm, 255, scrname+".window.focus.alpha", altscrname+".Window.Focus.Alpha"), |
288 | unfocused_alpha(rm, 255, scrname+".window.unfocus.alpha", altscrname+".Window.Unfocus.Alpha"), | 288 | unfocused_alpha(rm, 255, scrname+".window.unfocus.alpha", altscrname+".Window.Unfocus.Alpha"), |
289 | menu_alpha(rm, 255, scrname+".menu.alpha", altscrname+".Menu.Alpha"), | 289 | menu_alpha(rm, 255, scrname+".menu.alpha", altscrname+".Menu.Alpha"), |
290 | menu_delay(rm, 0, scrname + ".menuDelay", altscrname+".MenuDelay"), | 290 | menu_delay(rm, 200, scrname + ".menuDelay", altscrname+".MenuDelay"), |
291 | menu_delay_close(rm, 0, scrname + ".menuDelayClose", altscrname+".MenuDelayClose"), | 291 | menu_delay_close(rm, 200, scrname + ".menuDelayClose", altscrname+".MenuDelayClose"), |
292 | tab_width(rm, 64, scrname + ".tab.width", altscrname+".Tab.Width"), | 292 | tab_width(rm, 64, scrname + ".tab.width", altscrname+".Tab.Width"), |
293 | tooltip_delay(rm, 500, scrname + ".tooltipDelay", altscrname+".TooltipDelay"), | ||
293 | menu_mode(rm, FbTk::MenuTheme::DELAY_OPEN, scrname+".menuMode", altscrname+".MenuMode"), | 294 | menu_mode(rm, FbTk::MenuTheme::DELAY_OPEN, scrname+".menuMode", altscrname+".MenuMode"), |
294 | 295 | ||
295 | gc_line_width(rm, 1, scrname+".overlay.lineWidth", altscrname+".Overlay.LineWidth"), | 296 | gc_line_width(rm, 1, scrname+".overlay.lineWidth", altscrname+".Overlay.LineWidth"), |
@@ -341,8 +342,9 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
341 | m_pressed_winbutton_theme(new WinButtonTheme(scrn, ".pressed", ".Pressed", *m_focused_windowtheme)), | 342 | m_pressed_winbutton_theme(new WinButtonTheme(scrn, ".pressed", ".Pressed", *m_focused_windowtheme)), |
342 | m_menutheme(new FbTk::MenuTheme(scrn)), | 343 | m_menutheme(new FbTk::MenuTheme(scrn)), |
343 | m_root_window(scrn), | 344 | m_root_window(scrn), |
344 | m_geom_window(m_root_window, *this, *m_focused_windowtheme), | 345 | m_geom_window(new OSDWindow(m_root_window, *this, *m_focused_windowtheme)), |
345 | m_pos_window(m_root_window, *this, *m_focused_windowtheme), | 346 | m_pos_window(new OSDWindow(m_root_window, *this, *m_focused_windowtheme)), |
347 | m_tooltip_window(new TooltipWindow(m_root_window, *this, *m_focused_windowtheme)), | ||
346 | m_dummy_window(scrn, -1, -1, 1, 1, 0, true, false, CopyFromParent, | 348 | m_dummy_window(scrn, -1, -1, 1, 1, 0, true, false, CopyFromParent, |
347 | InputOnly), | 349 | InputOnly), |
348 | resource(rm, screenname, altscreenname), | 350 | resource(rm, screenname, altscreenname), |
@@ -423,12 +425,14 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
423 | 425 | ||
424 | _FB_USES_NLS; | 426 | _FB_USES_NLS; |
425 | 427 | ||
428 | #ifdef DEBUG | ||
426 | fprintf(stderr, _FB_CONSOLETEXT(Screen, ManagingScreen, | 429 | fprintf(stderr, _FB_CONSOLETEXT(Screen, ManagingScreen, |
427 | "BScreen::BScreen: managing screen %d " | 430 | "BScreen::BScreen: managing screen %d " |
428 | "using visual 0x%lx, depth %d\n", | 431 | "using visual 0x%lx, depth %d\n", |
429 | "informational message saying screen number (%d), visual (%lx), and colour depth (%d)").c_str(), | 432 | "informational message saying screen number (%d), visual (%lx), and colour depth (%d)").c_str(), |
430 | screenNumber(), XVisualIDFromVisual(rootWindow().visual()), | 433 | screenNumber(), XVisualIDFromVisual(rootWindow().visual()), |
431 | rootWindow().depth()); | 434 | rootWindow().depth()); |
435 | #endif // DEBUG | ||
432 | 436 | ||
433 | FbTk::EventManager *evm = FbTk::EventManager::instance(); | 437 | FbTk::EventManager *evm = FbTk::EventManager::instance(); |
434 | evm->add(*this, rootWindow()); | 438 | evm->add(*this, rootWindow()); |
@@ -442,7 +446,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
442 | fluxbox->load_rc(*this); | 446 | fluxbox->load_rc(*this); |
443 | 447 | ||
444 | // setup image cache engine | 448 | // setup image cache engine |
445 | m_image_control.reset(new FbTk::ImageControl(scrn, true, | 449 | m_image_control.reset(new FbTk::ImageControl(scrn, |
446 | fluxbox->colorsPerChannel(), | 450 | fluxbox->colorsPerChannel(), |
447 | fluxbox->getCacheLife(), fluxbox->getCacheMax())); | 451 | fluxbox->getCacheLife(), fluxbox->getCacheMax())); |
448 | imageControl().installRootColormap(); | 452 | imageControl().installRootColormap(); |
@@ -475,13 +479,12 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
475 | m_menutheme->setDelayOpen(*resource.menu_delay); | 479 | m_menutheme->setDelayOpen(*resource.menu_delay); |
476 | m_menutheme->setDelayClose(*resource.menu_delay_close); | 480 | m_menutheme->setDelayClose(*resource.menu_delay_close); |
477 | 481 | ||
478 | imageControl().setDither(*resource.image_dither); | ||
479 | |||
480 | focusedWinFrameTheme()->reconfigSig().attach(this);// for geom window | 482 | focusedWinFrameTheme()->reconfigSig().attach(this);// for geom window |
481 | 483 | ||
482 | 484 | ||
483 | renderGeomWindow(); | 485 | renderGeomWindow(); |
484 | renderPosWindow(); | 486 | renderPosWindow(); |
487 | m_tooltip_window->setDelay(*resource.tooltip_delay); | ||
485 | 488 | ||
486 | // setup workspaces and workspace menu | 489 | // setup workspaces and workspace menu |
487 | int nr_ws = *resource.workspaces; | 490 | int nr_ws = *resource.workspaces; |
@@ -497,6 +500,15 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
497 | // own resources we must do this. | 500 | // own resources we must do this. |
498 | fluxbox->load_rc(*this); | 501 | fluxbox->load_rc(*this); |
499 | 502 | ||
503 | m_windowmenu.reset(createMenu("")); | ||
504 | m_windowmenu->setInternalMenu(); | ||
505 | m_windowmenu->setReloadHelper(new FbTk::AutoReloadHelper()); | ||
506 | m_windowmenu->reloadHelper()->setReloadCmd(FbTk::RefCount<FbTk::Command<void> >(new FbTk::SimpleCommand<BScreen>(*this, &BScreen::rereadWindowMenu))); | ||
507 | |||
508 | m_rootmenu.reset(createMenu("")); | ||
509 | m_rootmenu->setReloadHelper(new FbTk::AutoReloadHelper()); | ||
510 | m_rootmenu->reloadHelper()->setReloadCmd(FbTk::RefCount<FbTk::Command<void> >(new FbTk::SimpleCommand<BScreen>(*this, &BScreen::rereadMenu))); | ||
511 | |||
500 | m_configmenu.reset(createMenu(_FB_XTEXT(Menu, Configuration, | 512 | m_configmenu.reset(createMenu(_FB_XTEXT(Menu, Configuration, |
501 | "Configuration", "Title of configuration menu"))); | 513 | "Configuration", "Title of configuration menu"))); |
502 | setupConfigmenu(*m_configmenu.get()); | 514 | setupConfigmenu(*m_configmenu.get()); |
@@ -884,8 +896,8 @@ void BScreen::cycleFocus(int options, const ClientPattern *pat, bool reverse) { | |||
884 | 896 | ||
885 | } | 897 | } |
886 | 898 | ||
887 | FbTk::Menu *BScreen::createMenu(const string &label) { | 899 | FbMenu *BScreen::createMenu(const string &label) { |
888 | FbTk::Menu *menu = new FbMenu(menuTheme(), | 900 | FbMenu *menu = new FbMenu(menuTheme(), |
889 | imageControl(), | 901 | imageControl(), |
890 | *layerManager().getLayer(Layer::MENU)); | 902 | *layerManager().getLayer(Layer::MENU)); |
891 | if (!label.empty()) | 903 | if (!label.empty()) |
@@ -893,8 +905,9 @@ FbTk::Menu *BScreen::createMenu(const string &label) { | |||
893 | 905 | ||
894 | return menu; | 906 | return menu; |
895 | } | 907 | } |
896 | FbTk::Menu *BScreen::createToggleMenu(const string &label) { | 908 | |
897 | FbTk::Menu *menu = new ToggleMenu(menuTheme(), | 909 | FbMenu *BScreen::createToggleMenu(const string &label) { |
910 | FbMenu *menu = new ToggleMenu(menuTheme(), | ||
898 | imageControl(), | 911 | imageControl(), |
899 | *layerManager().getLayer(Layer::MENU)); | 912 | *layerManager().getLayer(Layer::MENU)); |
900 | if (!label.empty()) | 913 | if (!label.empty()) |
@@ -907,9 +920,7 @@ void BScreen::addExtraWindowMenu(const FbTk::FbString &label, FbTk::Menu *menu) | |||
907 | menu->setInternalMenu(); | 920 | menu->setInternalMenu(); |
908 | menu->disableTitle(); | 921 | menu->disableTitle(); |
909 | m_extramenus.push_back(make_pair(label, menu)); | 922 | m_extramenus.push_back(make_pair(label, menu)); |
910 | // recreate window menu | 923 | rereadWindowMenu(); |
911 | m_windowmenu.reset(MenuCreator::createMenuType("windowmenu", screenNumber())); | ||
912 | m_windowmenu->setInternalMenu(); | ||
913 | } | 924 | } |
914 | 925 | ||
915 | void BScreen::reconfigure() { | 926 | void BScreen::reconfigure() { |
@@ -951,21 +962,9 @@ void BScreen::reconfigure() { | |||
951 | } | 962 | } |
952 | } | 963 | } |
953 | 964 | ||
954 | // if timestamp hasn't changed, then just a reconfigure is fine | 965 | // update menu filenames |
955 | // and that seems to happen somewhere else, anyway | 966 | m_rootmenu->reloadHelper()->setMainFile(fluxbox->getMenuFilename()); |
956 | if (fluxbox->menuTimestampsChanged()) { | 967 | m_windowmenu->reloadHelper()->setMainFile(windowMenuFilename()); |
957 | // all bets are off, so just hide the menu and reset the filenames | ||
958 | fluxbox->clearMenuFilenames(); | ||
959 | m_rootmenu->hide(); | ||
960 | rereadMenu(); | ||
961 | } | ||
962 | |||
963 | //reconfigure menus | ||
964 | m_workspacemenu->reconfigure(); | ||
965 | m_configmenu->reconfigure(); | ||
966 | // recreate window menu | ||
967 | m_windowmenu.reset(MenuCreator::createMenuType("windowmenu", screenNumber())); | ||
968 | m_windowmenu->setInternalMenu(); | ||
969 | 968 | ||
970 | // reconfigure workspaces | 969 | // reconfigure workspaces |
971 | for_each(m_workspaces_list.begin(), | 970 | for_each(m_workspaces_list.begin(), |
@@ -998,12 +997,6 @@ void BScreen::reconfigureTabs() { | |||
998 | (*it)->fbwindow()->applyDecorations(); | 997 | (*it)->fbwindow()->applyDecorations(); |
999 | } | 998 | } |
1000 | 999 | ||
1001 | |||
1002 | void BScreen::rereadMenu() { | ||
1003 | initMenu(); | ||
1004 | m_rootmenu->reconfigure(); | ||
1005 | } | ||
1006 | |||
1007 | void BScreen::updateWorkspaceName(unsigned int w) { | 1000 | void BScreen::updateWorkspaceName(unsigned int w) { |
1008 | Workspace *space = getWorkspace(w); | 1001 | Workspace *space = getWorkspace(w); |
1009 | if (space) { | 1002 | if (space) { |
@@ -1205,7 +1198,7 @@ void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS | |||
1205 | if (!win) | 1198 | if (!win) |
1206 | win = FocusControl::focusedFbWindow(); | 1199 | win = FocusControl::focusedFbWindow(); |
1207 | 1200 | ||
1208 | if (!win || &win->screen() != this) | 1201 | if (!win || &win->screen() != this || win->isStuck()) |
1209 | return; | 1202 | return; |
1210 | 1203 | ||
1211 | FbTk::App::instance()->sync(false); | 1204 | FbTk::App::instance()->sync(false); |
@@ -1437,7 +1430,7 @@ void BScreen::clearStrut(Strut *str) { | |||
1437 | clearStrut(str->next()); | 1430 | clearStrut(str->next()); |
1438 | int head = str->head() ? str->head() - 1 : 0; | 1431 | int head = str->head() ? str->head() - 1 : 0; |
1439 | /* The number of heads may have changed, be careful. */ | 1432 | /* The number of heads may have changed, be careful. */ |
1440 | if (head < numHeads()) | 1433 | if (head < (numHeads() ? numHeads() : 1)) |
1441 | m_head_areas[head]->clearStrut(str); | 1434 | m_head_areas[head]->clearStrut(str); |
1442 | // str is invalid now | 1435 | // str is invalid now |
1443 | } | 1436 | } |
@@ -1495,48 +1488,53 @@ void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id, | |||
1495 | 1488 | ||
1496 | void BScreen::initMenus() { | 1489 | void BScreen::initMenus() { |
1497 | m_workspacemenu.reset(MenuCreator::createMenuType("workspacemenu", screenNumber())); | 1490 | m_workspacemenu.reset(MenuCreator::createMenuType("workspacemenu", screenNumber())); |
1498 | m_windowmenu.reset(MenuCreator::createMenuType("windowmenu", screenNumber())); | 1491 | m_rootmenu->reloadHelper()->setMainFile(Fluxbox::instance()->getMenuFilename()); |
1499 | m_windowmenu->setInternalMenu(); | 1492 | m_windowmenu->reloadHelper()->setMainFile(windowMenuFilename()); |
1500 | initMenu(); | ||
1501 | } | 1493 | } |
1502 | 1494 | ||
1503 | 1495 | ||
1504 | void BScreen::initMenu() { | 1496 | void BScreen::rereadMenu() { |
1505 | |||
1506 | if (m_rootmenu.get()) { | ||
1507 | // since all menus in root is submenus in m_rootmenu | ||
1508 | // just remove every item in m_rootmenu and then clear m_rootmenu_list | ||
1509 | while (m_rootmenu->numberOfItems()) | ||
1510 | m_rootmenu->remove(0); | ||
1511 | m_rootmenu_list.clear(); | ||
1512 | 1497 | ||
1513 | } else | 1498 | m_rootmenu->removeAll(); |
1514 | m_rootmenu.reset(createMenu("")); | 1499 | m_rootmenu->setLabel(""); |
1515 | 1500 | ||
1516 | Fluxbox * const fb = Fluxbox::instance(); | 1501 | Fluxbox * const fb = Fluxbox::instance(); |
1517 | if (!fb->getMenuFilename().empty()) { | 1502 | if (!fb->getMenuFilename().empty()) |
1518 | m_rootmenu.reset(MenuCreator::createFromFile(fb->getMenuFilename(), | 1503 | MenuCreator::createFromFile(fb->getMenuFilename(), *m_rootmenu, |
1519 | screenNumber(), true)); | 1504 | m_rootmenu->reloadHelper()); |
1520 | |||
1521 | } | ||
1522 | 1505 | ||
1523 | if (m_rootmenu.get() == 0) { | 1506 | if (m_rootmenu->numberOfItems() == 0) { |
1524 | _FB_USES_NLS; | 1507 | _FB_USES_NLS; |
1525 | m_rootmenu.reset(createMenu(_FB_XTEXT(Menu, DefaultRootMenu, "Fluxbox default menu", "Title of fallback root menu"))); | 1508 | m_rootmenu->setLabel(_FB_XTEXT(Menu, DefaultRootMenu, "Fluxbox default menu", "Title of fallback root menu")); |
1526 | FbTk::RefCount<FbTk::Command<void> > restart_fb(FbTk::CommandParser<void>::instance().parse("restart")); | 1509 | FbTk::RefCount<FbTk::Command<void> > restart_fb(FbTk::CommandParser<void>::instance().parse("restart")); |
1527 | FbTk::RefCount<FbTk::Command<void> > exit_fb(FbTk::CommandParser<void>::instance().parse("exit")); | 1510 | FbTk::RefCount<FbTk::Command<void> > exit_fb(FbTk::CommandParser<void>::instance().parse("exit")); |
1528 | FbTk::RefCount<FbTk::Command<void> > execute_xterm(FbTk::CommandParser<void>::instance().parse("exec xterm")); | 1511 | FbTk::RefCount<FbTk::Command<void> > execute_xterm(FbTk::CommandParser<void>::instance().parse("exec xterm")); |
1529 | m_rootmenu->setInternalMenu(); | 1512 | m_rootmenu->setInternalMenu(); |
1530 | m_rootmenu->insert("xterm", execute_xterm); | 1513 | m_rootmenu->insert("xterm", execute_xterm); |
1514 | m_rootmenu->insert(_FB_XTEXT(Menu, Reconfigure, "Reconfigure", | ||
1515 | "Reload Configuration command")), | ||
1531 | m_rootmenu->insert(_FB_XTEXT(Menu, Restart, "Restart", "Restart command"), | 1516 | m_rootmenu->insert(_FB_XTEXT(Menu, Restart, "Restart", "Restart command"), |
1532 | restart_fb); | 1517 | restart_fb); |
1533 | m_rootmenu->insert(_FB_XTEXT(Menu, Exit, "Exit", "Exit command"), | 1518 | m_rootmenu->insert(_FB_XTEXT(Menu, Exit, "Exit", "Exit command"), |
1534 | exit_fb); | 1519 | exit_fb); |
1535 | } | 1520 | } |
1536 | 1521 | ||
1537 | m_rootmenu->updateMenu(); | ||
1538 | } | 1522 | } |
1539 | 1523 | ||
1524 | const std::string BScreen::windowMenuFilename() const { | ||
1525 | if ((*resource.windowmenufile).empty()) | ||
1526 | return Fluxbox::instance()->getDefaultDataFilename("windowmenu"); | ||
1527 | return *resource.windowmenufile; | ||
1528 | } | ||
1529 | |||
1530 | void BScreen::rereadWindowMenu() { | ||
1531 | |||
1532 | m_windowmenu->removeAll(); | ||
1533 | if (!windowMenuFilename().empty()) | ||
1534 | MenuCreator::createFromFile(windowMenuFilename(), *m_windowmenu, | ||
1535 | m_windowmenu->reloadHelper()); | ||
1536 | |||
1537 | } | ||
1540 | 1538 | ||
1541 | void BScreen::addConfigMenu(const FbTk::FbString &label, FbTk::Menu &menu) { | 1539 | void BScreen::addConfigMenu(const FbTk::FbString &label, FbTk::Menu &menu) { |
1542 | m_configmenu_list.push_back(make_pair(label, &menu)); | 1540 | m_configmenu_list.push_back(make_pair(label, &menu)); |
@@ -1775,9 +1773,6 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1775 | for (; it != it_end; ++it) | 1773 | for (; it != it_end; ++it) |
1776 | menu.insert(it->first, it->second); | 1774 | menu.insert(it->first, it->second); |
1777 | 1775 | ||
1778 | _BOOLITEM(menu, Configmenu, ImageDithering, | ||
1779 | "Image Dithering", "Image Dithering", | ||
1780 | resource.image_dither, save_and_reconfigure); | ||
1781 | _BOOLITEM(menu, Configmenu, OpaqueMove, | 1776 | _BOOLITEM(menu, Configmenu, OpaqueMove, |
1782 | "Opaque Window Moving", | 1777 | "Opaque Window Moving", |
1783 | "Window Moving with whole window visible (as opposed to outline moving)", | 1778 | "Window Moving with whole window visible (as opposed to outline moving)", |
@@ -1817,12 +1812,12 @@ void BScreen::showPosition(int x, int y) { | |||
1817 | 1812 | ||
1818 | char label[256]; | 1813 | char label[256]; |
1819 | sprintf(label, "X:%5d x Y:%5d", x, y); | 1814 | sprintf(label, "X:%5d x Y:%5d", x, y); |
1820 | m_pos_window.showText(label); | 1815 | m_pos_window->showText(label); |
1821 | } | 1816 | } |
1822 | 1817 | ||
1823 | 1818 | ||
1824 | void BScreen::hidePosition() { | 1819 | void BScreen::hidePosition() { |
1825 | m_pos_window.hide(); | 1820 | m_pos_window->hide(); |
1826 | } | 1821 | } |
1827 | 1822 | ||
1828 | // can be negative when base_width/height > min_width/height | 1823 | // can be negative when base_width/height > min_width/height |
@@ -1838,12 +1833,23 @@ void BScreen::showGeometry(int gx, int gy) { | |||
1838 | "W: %4d x H: %4d", | 1833 | "W: %4d x H: %4d", |
1839 | "Format for width and height window, %4d for width, and %4d for height").c_str(), | 1834 | "Format for width and height window, %4d for width, and %4d for height").c_str(), |
1840 | gx, gy); | 1835 | gx, gy); |
1841 | m_geom_window.showText(label); | 1836 | m_geom_window->showText(label); |
1837 | } | ||
1838 | |||
1839 | |||
1840 | void BScreen::showTooltip(const std::string &text) { | ||
1841 | if (*resource.tooltip_delay >= 0) | ||
1842 | m_tooltip_window->showText(text); | ||
1843 | } | ||
1844 | |||
1845 | void BScreen::hideTooltip() { | ||
1846 | if (*resource.tooltip_delay >= 0) | ||
1847 | m_tooltip_window->hide(); | ||
1842 | } | 1848 | } |
1843 | 1849 | ||
1844 | 1850 | ||
1845 | void BScreen::hideGeometry() { | 1851 | void BScreen::hideGeometry() { |
1846 | m_geom_window.hide(); | 1852 | m_geom_window->hide(); |
1847 | } | 1853 | } |
1848 | 1854 | ||
1849 | void BScreen::setLayer(FbTk::XLayerItem &item, int layernum) { | 1855 | void BScreen::setLayer(FbTk::XLayerItem &item, int layernum) { |
@@ -1891,14 +1897,14 @@ void BScreen::renderGeomWindow() { | |||
1891 | _FB_XTEXT(Screen, GeometrySpacing, | 1897 | _FB_XTEXT(Screen, GeometrySpacing, |
1892 | "W: %04d x H: %04d", "Representative maximum sized text for width and height dialog").c_str(), | 1898 | "W: %04d x H: %04d", "Representative maximum sized text for width and height dialog").c_str(), |
1893 | 0, 0); | 1899 | 0, 0); |
1894 | m_geom_window.resize(label); | 1900 | m_geom_window->resize(label); |
1895 | m_geom_window.reconfigTheme(); | 1901 | m_geom_window->reconfigTheme(); |
1896 | } | 1902 | } |
1897 | 1903 | ||
1898 | 1904 | ||
1899 | void BScreen::renderPosWindow() { | 1905 | void BScreen::renderPosWindow() { |
1900 | m_pos_window.resize("0:00000 x 0:00000"); | 1906 | m_pos_window->resize("0:00000 x 0:00000"); |
1901 | m_pos_window.reconfigTheme(); | 1907 | m_pos_window->reconfigTheme(); |
1902 | } | 1908 | } |
1903 | 1909 | ||
1904 | void BScreen::updateSize() { | 1910 | void BScreen::updateSize() { |