From e148f58d0ec90f532df7c6c882e331c8bc8b7a59 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 18 Apr 2002 02:05:51 +0000 Subject: [PATCH] maps/unmaps the toolbar when its resource setting is loaded from the file so it takes effect during a reconfigure. --- src/Screen.cc | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index 0b86493f..3d193295 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -232,9 +232,14 @@ BScreen::BScreen(Openbox &ob, int scrn, Resource &conf) : ScreenInfo(ob, scrn), rootmenu = 0; resource.mstyle.t_fontset = resource.mstyle.f_fontset = - resource.tstyle.fontset = resource.wstyle.fontset = (XFontSet) 0; + resource.tstyle.fontset = resource.wstyle.fontset = NULL; resource.mstyle.t_font = resource.mstyle.f_font = resource.tstyle.font = - resource.wstyle.font = (XFontStruct *) 0; + resource.wstyle.font = NULL; + +#ifdef SLIT + slit = NULL; +#endif // SLIT + toolbar = NULL; #ifdef HAVE_GETPID pid_t bpid = getpid(); @@ -415,7 +420,7 @@ BScreen::BScreen(Openbox &ob, int scrn, Resource &conf) : ScreenInfo(ob, scrn), iconmenu = new Iconmenu(*this); configmenu = new Configmenu(*this); - Workspace *wkspc = (Workspace *) 0; + Workspace *wkspc = NULL; if (resource.workspaces != 0) { for (int i = 0; i < resource.workspaces; ++i) { wkspc = new Workspace(*this, workspacesList->count()); @@ -1058,6 +1063,13 @@ void BScreen::load() { rclass << rscreen.str() << "HideToolbar" << ends; if (config.getValue(rname.str(), rclass.str(), b)) resource.hide_toolbar = b; + Toolbar *t = getToolbar(); + if (t != NULL) { + if (resource.hide_toolbar) + t->unMapToolbar(); + else + t->mapToolbar(); + } rname.seekp(0); rclass.seekp(0); rname << rscreen.str() << "fullMaximization" << ends; @@ -1730,7 +1742,7 @@ OpenboxWindow *BScreen::getIcon(int index) { if (index >= 0 && index < iconList->count()) return iconList->find(index); - return (OpenboxWindow *) 0; + return NULL; } @@ -1789,7 +1801,7 @@ void BScreen::changeWorkspaceID(int id) { openbox.getFocusedWindow()->getScreen() == this && (! openbox.getFocusedWindow()->isStuck())) { current_workspace->setLastFocusedWindow(openbox.getFocusedWindow()); - openbox.setFocusedWindow((OpenboxWindow *) 0); + openbox.setFocusedWindow(NULL); } current_workspace = getWorkspace(id); @@ -1956,7 +1968,7 @@ void BScreen::addWorkspaceName(const char *name) { } char* BScreen::getNameOfWorkspace(int id) { - char *name = (char *) 0; + char *name = NULL; if (id >= 0 && id < workspaceNames->count()) { char *wkspc_name = workspaceNames->find(id); -- 2.45.2