diff options
author | akir <akir> | 2004-10-18 01:26:54 (GMT) |
---|---|---|
committer | akir <akir> | 2004-10-18 01:26:54 (GMT) |
commit | 496d73d89994d868f5dc45a5ea6cefe40a74f148 (patch) | |
tree | f8a9b4102403e4d58082d17d7dbc406ea3360f81 /src/fluxbox.cc | |
parent | 2760b03b2e0a7ee93e4ce70daf73faa609076dff (diff) | |
download | fluxbox_pavel-496d73d89994d868f5dc45a5ea6cefe40a74f148.zip fluxbox_pavel-496d73d89994d868f5dc45a5ea6cefe40a74f148.tar.bz2 |
rewritten fluxbox-restart code, all destructors are called before the
new program is started. the former method didnt do that.
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r-- | src/fluxbox.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 3563c8c..cfceaf7 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: fluxbox.cc,v 1.258 2004/10/10 16:06:23 akir Exp $ | 25 | // $Id: fluxbox.cc,v 1.259 2004/10/18 01:26:54 akir Exp $ |
26 | 26 | ||
27 | #include "fluxbox.hh" | 27 | #include "fluxbox.hh" |
28 | 28 | ||
@@ -238,6 +238,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile | |||
238 | m_rc_file(rcfilename ? rcfilename : ""), | 238 | m_rc_file(rcfilename ? rcfilename : ""), |
239 | m_argv(argv), m_argc(argc), | 239 | m_argv(argv), m_argc(argc), |
240 | m_starting(true), | 240 | m_starting(true), |
241 | m_restarting(false), | ||
241 | m_shutdown(false), | 242 | m_shutdown(false), |
242 | m_server_grabs(0), | 243 | m_server_grabs(0), |
243 | m_randr_event_type(0), | 244 | m_randr_event_type(0), |
@@ -457,6 +458,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile | |||
457 | 458 | ||
458 | 459 | ||
459 | Fluxbox::~Fluxbox() { | 460 | Fluxbox::~Fluxbox() { |
461 | |||
460 | // destroy toolbars | 462 | // destroy toolbars |
461 | while (!m_toolbars.empty()) { | 463 | while (!m_toolbars.empty()) { |
462 | delete m_toolbars.back(); | 464 | delete m_toolbars.back(); |
@@ -1357,14 +1359,11 @@ void Fluxbox::removeGroupSearch(Window window) { | |||
1357 | void Fluxbox::restart(const char *prog) { | 1359 | void Fluxbox::restart(const char *prog) { |
1358 | shutdown(); | 1360 | shutdown(); |
1359 | 1361 | ||
1362 | m_restarting = true; | ||
1363 | |||
1360 | if (prog) { | 1364 | if (prog) { |
1361 | execlp(prog, prog, 0); | 1365 | m_restart_argument = prog; |
1362 | perror(prog); | ||
1363 | } | 1366 | } |
1364 | |||
1365 | // fall back in case the above execlp doesn't work | ||
1366 | execvp(m_argv[0], m_argv); | ||
1367 | execvp(StringUtil::basename(m_argv[0]).c_str(), m_argv); | ||
1368 | } | 1367 | } |
1369 | 1368 | ||
1370 | /// prepares fluxbox for a shutdown | 1369 | /// prepares fluxbox for a shutdown |
@@ -1377,7 +1376,8 @@ void Fluxbox::shutdown() { | |||
1377 | XSetInputFocus(FbTk::App::instance()->display(), PointerRoot, None, CurrentTime); | 1376 | XSetInputFocus(FbTk::App::instance()->display(), PointerRoot, None, CurrentTime); |
1378 | 1377 | ||
1379 | //send shutdown to all screens | 1378 | //send shutdown to all screens |
1380 | for_each(m_screen_list.begin(), m_screen_list.end(), mem_fun(&BScreen::shutdown)); | 1379 | for_each(m_screen_list.begin(), |
1380 | m_screen_list.end(), mem_fun(&BScreen::shutdown)); | ||
1381 | 1381 | ||
1382 | sync(false); | 1382 | sync(false); |
1383 | 1383 | ||