diff options
author | portix <portix@gmx.net> | 2012-03-12 17:00:30 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2012-03-12 17:00:30 +0100 |
commit | 8ec3c8bb8d0526f9ebdd052422a8d3f81b766045 (patch) | |
tree | 286a22809f75809f1238f43992959400ff309361 /src/session.c | |
parent | 70845d4bbca4692cb40696615f78532145c0a836 (diff) | |
download | dwb-8ec3c8bb8d0526f9ebdd052422a8d3f81b766045.zip |
Only save sessions automatically from session that restored a session automatically
Diffstat (limited to 'src/session.c')
-rw-r--r-- | src/session.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/session.c b/src/session.c index 3b115937..a3fc1ac3 100644 --- a/src/session.c +++ b/src/session.c @@ -24,6 +24,7 @@ #include "session.h" static char *_session_name; +static gboolean _has_marked = true; typedef struct _SessionTab { GList *gl; @@ -180,6 +181,7 @@ session_restore(char *name, gboolean force) { fprintf(stderr, "Warning: Session '%s' will not be restored.\n", name); fprintf(stderr, "There is already a restored session open with name '%s'.\n", name); fputs("To force opening a saved session use -f or --force.\n", stderr); + _has_marked = false; return false; } _session_name = name; @@ -240,9 +242,9 @@ session_save(const char *name, gboolean force) { name = _session_name; else if (force) name = "default"; - else - return false; } + if (!_has_marked && !force) + return false; GString *buffer = g_string_new(NULL); for (GList *l = g_list_first(dwb.state.views); l; l=l->next) { |