X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FScreen.cc;h=313aeb21e8efa2c9a053832334f2d47298b50759;hb=f27fe4edbbd0f3abde228737bd37d1be128e01f3;hp=251faadd429464f1ad5f960109df48830ff6f31d;hpb=9cd9d92bb1d66db9329bf5cd6e42e8b0096945e6;p=chaz%2Fopenbox diff --git a/src/Screen.cc b/src/Screen.cc index 251faadd..313aeb21 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(); @@ -249,9 +254,6 @@ BScreen::BScreen(Openbox &ob, int scrn, Resource &conf) : ScreenInfo(ob, scrn), openbox.getSessionCursor()); workspaceNames = new LinkedList; - - load(); // load config options from Resources - workspacesList = new LinkedList; rootmenuList = new LinkedList; netizenList = new LinkedList; @@ -265,6 +267,7 @@ BScreen::BScreen(Openbox &ob, int scrn, Resource &conf) : ScreenInfo(ob, scrn), image_control->setDither(resource.image_dither); + load(); // load config options from Resources LoadStyle(); XGCValues gcv; @@ -417,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()); @@ -1040,7 +1043,8 @@ void BScreen::save() { #ifdef HAVE_STRFTIME // it deletes the current value before setting the new one, so we have to // duplicate the current value. - setStrftimeFormat(bstrdup(resource.strftime_format)); + std::string s = resource.strftime_format; + setStrftimeFormat(s.c_str()); #else // !HAVE_STRFTIME setDateFormat(resource.date_format); setClock24Hour(resource.clock24hour); @@ -1059,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; @@ -1206,11 +1217,16 @@ void BScreen::load() { rname.seekp(0); rclass.seekp(0); rname << rscreen.str() << "opaqueMove" << ends; rclass << rscreen.str() << "OpaqueMove" << ends; + if (config.getValue(rname.str(), rclass.str(), b)) resource.opaque_move = b; } void BScreen::reconfigure(void) { load(); + toolbar->load(); +#ifdef SLIT + slit->load(); +#endif // SLIT LoadStyle(); XGCValues gcv; @@ -1726,7 +1742,7 @@ OpenboxWindow *BScreen::getIcon(int index) { if (index >= 0 && index < iconList->count()) return iconList->find(index); - return (OpenboxWindow *) 0; + return NULL; } @@ -1785,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); @@ -1952,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); @@ -2144,7 +2160,7 @@ void BScreen::InitMenu(void) { rootmenu->insert(i18n->getMessage(ScreenSet, ScreenExit, "Exit"), BScreen::Exit); } else { - openbox.saveMenuFilename(openbox.getMenuFilename()); + openbox.setMenuFilename(openbox.getMenuFilename()); } } @@ -2345,7 +2361,7 @@ Bool BScreen::parseMenuFile(FILE *file, Rootmenu *menu) { if (! feof(submenufile)) { if (! parseMenuFile(submenufile, menu)) - openbox.saveMenuFilename(newfile); + openbox.setMenuFilename(newfile); fclose(submenufile); } @@ -2504,7 +2520,7 @@ Bool BScreen::parseMenuFile(FILE *file, Rootmenu *menu) { rootmenuList->insert(stylesmenu); } - openbox.saveMenuFilename(stylesdir); + openbox.setMenuFilename(stylesdir); } else { fprintf(stderr, i18n->getMessage(ScreenSet, ScreenSTYLESDIRErrorNotDir,