From 6b391c3beadc35c22c93c892c0bdcdd6a4448bb9 Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Mon, 8 Sep 2008 18:50:25 -0400 Subject: update workspace names atoms/resources when adding a new workspace also removed unnecessary items from default init file --- data/init.in | 29 ----------------------------- src/FbCommands.cc | 3 --- src/Screen.cc | 12 +++++------- src/Screen.hh | 2 -- src/Toolbar.cc | 2 +- 5 files changed, 6 insertions(+), 42 deletions(-) diff --git a/data/init.in b/data/init.in index a8fdccd..b26b56a 100644 --- a/data/init.in +++ b/data/init.in @@ -1,32 +1,3 @@ -session.screen0.slit.placement: RightBottom -session.screen0.slit.onTop: False -session.screen0.slit.autoHide: False -session.screen0.tab.placement: Top -session.screen0.toolbar.onTop: False -session.screen0.toolbar.autoHide: False -session.screen0.toolbar.placement: BottomCenter -session.screen0.toolbar.widthPercent: 66 -session.screen0.workspaceNames: one,two,three,four -session.screen0.strftimeFormat: %k:%M -session.screen0.focusNewWindows: True -session.screen0.focusModel: ClickToFocus -session.screen0.fullMaximization: False -session.screen0.edgeSnapThreshold: 10 -session.screen0.rowPlacementDirection: LeftToRight -session.screen0.workspaces: 4 -session.screen0.colPlacementDirection: TopToBottom -session.screen0.windowPlacement: RowSmartPlacement -session.screen0.tab.width: 64 -session.screen0.tab.height: 16 -session.screen0.showwindowposition: true -session.opaqueMove: False -session.autoRaiseDelay: 250 session.menuFile: ~/.@pkgprefix@fluxbox@pkgsuffix@/menu -session.cacheLife: 5 -session.styleFile: @default_style@ session.keyFile: ~/.@pkgprefix@fluxbox@pkgsuffix@/keys -session.colorsPerChannel: 4 -session.doubleClickInterval: 250 -session.cacheMax: 200 -session.imageDither: True session.configVersion: 10 diff --git a/src/FbCommands.cc b/src/FbCommands.cc index 8875ec2..fd3f71e 100644 --- a/src/FbCommands.cc +++ b/src/FbCommands.cc @@ -414,9 +414,6 @@ void SetWorkspaceNameCmd::execute() { return; space->setName(m_name); } - - screen->updateWorkspaceNamesAtom(); - Fluxbox::instance()->save_rc(); } REGISTER_COMMAND(setworkspacenamedialog, FbCommands::WorkspaceNameDialogCmd, void); diff --git a/src/Screen.cc b/src/Screen.cc index ac5b11e..4412d29 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1021,7 +1021,7 @@ void BScreen::updateWorkspaceName(unsigned int w) { Workspace *space = getWorkspace(w); if (space) { m_workspace_names[w] = space->name(); - updateWorkspaceNamesAtom(); + m_workspacenames_sig.notify(); Fluxbox::instance()->save_rc(); } } @@ -1030,10 +1030,6 @@ void BScreen::removeWorkspaceNames() { m_workspace_names.clear(); } -void BScreen::updateWorkspaceNamesAtom() { - m_workspacenames_sig.notify(); -} - void BScreen::addIcon(FluxboxWindow *w) { if (w == 0) return; @@ -1104,14 +1100,16 @@ void BScreen::removeClient(WinClient &client) { int BScreen::addWorkspace() { - bool save_name = getNameOfWorkspace(m_workspaces_list.size()) != "" ? false : true; + bool save_name = getNameOfWorkspace(m_workspaces_list.size()) == ""; Workspace *wkspc = new Workspace(*this, getNameOfWorkspace(m_workspaces_list.size()), m_workspaces_list.size()); m_workspaces_list.push_back(wkspc); - if (save_name) + if (save_name) { addWorkspaceName(wkspc->name().c_str()); //update names + m_workspacenames_sig.notify(); + } saveWorkspaces(m_workspaces_list.size()); workspaceCountSig().notify(); diff --git a/src/Screen.hh b/src/Screen.hh index 9800d19..ecf2f05 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -342,8 +342,6 @@ public: void updateWorkspaceName(unsigned int w); /// remove all workspace names void removeWorkspaceNames(); - /// update the workspace name atom - void updateWorkspaceNamesAtom(); /// add a workspace name to the end of the workspace name list void addWorkspaceName(const char *name); /// add a window to the icon list diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 73fd706..0292b87 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -231,7 +231,7 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width): m_rc_maximize_over(scrn.resourceManager(), false, scrn.name() + ".toolbar.maxOver", scrn.altName() + ".Toolbar.MaxOver"), m_rc_visible(scrn.resourceManager(), true, scrn.name() + ".toolbar.visible", scrn.altName() + ".Toolbar.Visible"), - m_rc_width_percent(scrn.resourceManager(), 65, + m_rc_width_percent(scrn.resourceManager(), 66, scrn.name() + ".toolbar.widthPercent", scrn.altName() + ".Toolbar.WidthPercent"), m_rc_alpha(scrn.resourceManager(), 255, scrn.name() + ".toolbar.alpha", scrn.altName() + ".Toolbar.Alpha"), -- cgit v0.11.2