aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsimonb <simonb>2006-04-22 16:38:20 (GMT)
committersimonb <simonb>2006-04-22 16:38:20 (GMT)
commit11190682277e3ac14d976738576f20df04e63dc5 (patch)
treeca69a43315e5b913fccd7d4d050b20411ee906d9 /src
parent932eebe0ddbc611ccf72cbebebbde656ae2d08ec (diff)
downloadfluxbox_paul-11190682277e3ac14d976738576f20df04e63dc5.zip
fluxbox_paul-11190682277e3ac14d976738576f20df04e63dc5.tar.bz2
fix crash when toolbar disabled
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc7
-rw-r--r--src/Slit.cc28
-rw-r--r--src/Slit.hh2
3 files changed, 19 insertions, 18 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index d19d16f..a26c370 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1687,13 +1687,6 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1687 1687
1688 menu.insert(tabmenu_label, tab_menu); 1688 menu.insert(tabmenu_label, tab_menu);
1689 1689
1690#ifdef SLIT
1691 if (slit() != 0) {
1692 slit()->menu().setInternalMenu();
1693 menu.insert("Slit", &slit()->menu());
1694 }
1695#endif // SLIT
1696
1697 Configmenus::iterator it = m_configmenu_list.begin(); 1690 Configmenus::iterator it = m_configmenu_list.begin();
1698 Configmenus::iterator it_end = m_configmenu_list.end(); 1691 Configmenus::iterator it_end = m_configmenu_list.end();
1699 for (; it != it_end; ++it) 1692 for (; it != it_end; ++it)
diff --git a/src/Slit.cc b/src/Slit.cc
index e8cd72c..af3a0be 100644
--- a/src/Slit.cc
+++ b/src/Slit.cc
@@ -260,9 +260,6 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename)
260 m_slitmenu(scr.menuTheme(), 260 m_slitmenu(scr.menuTheme(),
261 scr.imageControl(), 261 scr.imageControl(),
262 *scr.layerManager().getLayer(Layer::MENU)), 262 *scr.layerManager().getLayer(Layer::MENU)),
263 m_placement_menu(scr.menuTheme(),
264 scr.imageControl(),
265 *scr.layerManager().getLayer(Layer::MENU)),
266 m_clientlist_menu(scr.menuTheme(), 263 m_clientlist_menu(scr.menuTheme(),
267 scr.imageControl(), 264 scr.imageControl(),
268 *scr.layerManager().getLayer(Layer::MENU)), 265 *scr.layerManager().getLayer(Layer::MENU)),
@@ -274,6 +271,7 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename)
274 "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False)), //KDE v2.x 271 "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False)), //KDE v2.x
275 272
276 m_layeritem(0), 273 m_layeritem(0),
274
277 m_slit_theme(new SlitTheme(scr.rootWindow().screenNumber())), 275 m_slit_theme(new SlitTheme(scr.rootWindow().screenNumber())),
278 m_strut(0), 276 m_strut(0),
279 // resources 277 // resources
@@ -301,6 +299,8 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename)
301 scr.resizeSig().attach(this); 299 scr.resizeSig().attach(this);
302 scr.reconfigureSig().attach(this); // if alpha changed (we disablethis signal when we get theme change sig) 300 scr.reconfigureSig().attach(this); // if alpha changed (we disablethis signal when we get theme change sig)
303 301
302 scr.addConfigMenu(_FBTEXT(Slit, Slit, "Slit", "The Slit"), m_slitmenu);
303
304 frame.pixmap = None; 304 frame.pixmap = None;
305 // move the frame out of sight for a moment 305 // move the frame out of sight for a moment
306 frame.window.move(-frame.window.width(), -frame.window.height()); 306 frame.window.move(-frame.window.width(), -frame.window.height());
@@ -1236,10 +1236,17 @@ void Slit::setupMenu() {
1236 FbTk::RefCount<FbTk::Command> save_and_reconfigure(s_a_reconf_macro); 1236 FbTk::RefCount<FbTk::Command> save_and_reconfigure(s_a_reconf_macro);
1237 FbTk::RefCount<FbTk::Command> save_and_reconfigure_slit(s_a_reconf_slit_macro); 1237 FbTk::RefCount<FbTk::Command> save_and_reconfigure_slit(s_a_reconf_slit_macro);
1238 1238
1239
1240 // it'll be freed by the slitmenu (since not marked internal)
1241 FbMenu *placement_menu = new FbMenu(m_screen.menuTheme(),
1242 m_screen.imageControl(),
1243 *m_screen.layerManager().getLayer(::Layer::MENU));
1244
1245
1239 // setup base menu 1246 // setup base menu
1240 m_slitmenu.setLabel(_FBTEXT(Slit, Slit, "Slit", "The Slit")); 1247 m_slitmenu.setLabel(_FBTEXT(Slit, Slit, "Slit", "The Slit"));
1241 m_slitmenu.insert(_FBTEXT(Menu, Placement, "Placement", "Title of Placement menu"), 1248 m_slitmenu.insert(_FBTEXT(Menu, Placement, "Placement", "Title of Placement menu"),
1242 &m_placement_menu); 1249 placement_menu);
1243 1250
1244 m_slitmenu.insert(_FBTEXT(Menu, Layer, "Layer...", "Title of Layer menu"), m_layermenu.get()); 1251 m_slitmenu.insert(_FBTEXT(Menu, Layer, "Layer...", "Title of Layer menu"), m_layermenu.get());
1245 1252
@@ -1287,10 +1294,11 @@ void Slit::setupMenu() {
1287 m_slitmenu.updateMenu(); 1294 m_slitmenu.updateMenu();
1288 1295
1289 // setup sub menu 1296 // setup sub menu
1290 m_placement_menu.setLabel(_FBTEXT(Slit, Placement, "Slit Placement", "Slit Placement")); 1297 placement_menu->setLabel(_FBTEXT(Slit, Placement, "Slit Placement", "Slit Placement"));
1291 m_placement_menu.setMinimumSublevels(3); 1298 placement_menu->setMinimumSublevels(3);
1292 m_layermenu->setInternalMenu(); 1299 m_layermenu->setInternalMenu();
1293 m_clientlist_menu.setInternalMenu(); 1300 m_clientlist_menu.setInternalMenu();
1301 m_slitmenu.setInternalMenu();
1294 1302
1295 typedef pair<const char *, Slit::Placement> PlacementP; 1303 typedef pair<const char *, Slit::Placement> PlacementP;
1296 typedef list<PlacementP> Placements; 1304 typedef list<PlacementP> Placements;
@@ -1314,10 +1322,10 @@ void Slit::setupMenu() {
1314 Slit::Placement placement = place_menu.front().second; 1322 Slit::Placement placement = place_menu.front().second;
1315 1323
1316 if (str == 0) { 1324 if (str == 0) {
1317 m_placement_menu.insert(""); 1325 placement_menu->insert("");
1318 m_placement_menu.setItemEnabled(i, false); 1326 placement_menu->setItemEnabled(i, false);
1319 } else { 1327 } else {
1320 m_placement_menu.insert(new PlaceSlitMenuItem(str, *this, 1328 placement_menu->insert(new PlaceSlitMenuItem(str, *this,
1321 placement, 1329 placement,
1322 save_and_reconfigure)); 1330 save_and_reconfigure));
1323 1331
@@ -1326,7 +1334,7 @@ void Slit::setupMenu() {
1326 } 1334 }
1327 1335
1328 // finaly update sub menu 1336 // finaly update sub menu
1329 m_placement_menu.updateMenu(); 1337 placement_menu->updateMenu();
1330} 1338}
1331 1339
1332void Slit::moveToLayer(int layernum) { 1340void Slit::moveToLayer(int layernum) {
diff --git a/src/Slit.hh b/src/Slit.hh
index 4e090e4..a30933a 100644
--- a/src/Slit.hh
+++ b/src/Slit.hh
@@ -147,7 +147,7 @@ private:
147 FbTk::Timer m_timer; 147 FbTk::Timer m_timer;
148 148
149 SlitClients m_client_list; 149 SlitClients m_client_list;
150 FbMenu m_slitmenu, m_placement_menu, m_clientlist_menu; 150 FbMenu m_slitmenu, m_clientlist_menu;
151 std::auto_ptr<LayerMenu> m_layermenu; 151 std::auto_ptr<LayerMenu> m_layermenu;
152 std::string m_filename; 152 std::string m_filename;
153 153