From 270cbb65922487faded4b8997bd8cd4f57a2dc95 Mon Sep 17 00:00:00 2001 From: rathnor Date: Sat, 24 May 2003 05:49:31 +0000 Subject: toolbar crash (menu bug) and initialisation fixups --- ChangeLog | 3 +++ src/FbTk/Menu.cc | 5 ++--- src/Screen.cc | 9 +++------ src/Toolbar.cc | 5 +++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index fe22f35..396caf4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ (Format: Year/Month/Day) Changes for 0.9.3: +*03/05/24: + * Fix crash when toolbar turned off, and toolbar initialisation (Simon) + Menu.cc Screen.cc Toolbar.cc *03/05/21: * Fix cascade placement for multiple heads (Simon) Workspace.hh/cc Window.hh/cc FbWinFrame.hh/cc diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index a42193b..37d40fc 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Menu.cc,v 1.22 2003/05/17 10:44:32 fluxgen Exp $ +// $Id: Menu.cc,v 1.23 2003/05/24 05:49:31 rathnor Exp $ //use GNU extensions #ifndef _GNU_SOURCE @@ -270,8 +270,7 @@ int Menu::remove(unsigned int index) { void Menu::removeAll() { while (!menuitems.empty()) { - delete menuitems.back(); - menuitems.pop_back(); + remove(0); } m_need_update = true; } diff --git a/src/Screen.cc b/src/Screen.cc index 753acbe..c1bb3db 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.176 2003/05/22 01:17:15 rathnor Exp $ +// $Id: Screen.cc,v 1.177 2003/05/24 05:49:31 rathnor Exp $ #include "Screen.hh" @@ -654,11 +654,8 @@ BScreen::BScreen(FbTk::ResourceManager &rm, workspacemenu->setItemSelected(2, true); - if (toolbar()) { - toolbar()->setPlacement(*resource.toolbar_placement); - toolbar()->theme().font().setAntialias(*resource.antialias); - toolbar()->reconfigure(); - } + // if toolbar needs initialisation, do it in ToolbarHandler instead + // so it will work when destroyed later etc initMenu(); // create and initiate rootmenu diff --git a/src/Toolbar.cc b/src/Toolbar.cc index a000c99..e5b5a5a 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.cc,v 1.86 2003/05/19 15:32:47 rathnor Exp $ +// $Id: Toolbar.cc,v 1.87 2003/05/24 05:49:31 rathnor Exp $ #include "Toolbar.hh" @@ -279,7 +279,7 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi this, true), m_theme(scrn.screenNumber()), - m_place(BOTTOMCENTER), + m_place(scrn.toolbarPlacement()), m_themelistener(*this), m_layeritem(frame.window, layer) { @@ -332,6 +332,7 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi frame.pwbutton.setOnClick(prevwindow); frame.nwbutton.setOnClick(nextwindow); + reconfigure(); // get everything together frame.window.showSubwindows(); frame.window.show(); } -- cgit v0.11.2