On Mon, Mar 05, 2012 at 10:51:19PM +0100, Rainer Hurling wrote:
> 
> # ------------------------------------------------------------------
> # First run with fresh wmaker.inst: save session when leaving
> /usr/local/bin/wmaker(main(main.c:550)): restarting: 0, norestore: 0
> 
> /usr/local/bin/wmaker(main(main.c:550)): restarting: 0, norestore: 0
> 
> /usr/local/bin/wmaker(main(main.c:552)): Arg 1 is --for-real
> /usr/local/bin/wmaker(real_main(main.c:632)): Got --for-real, set
> restarting = 0
> /usr/local/bin/wmaker(main(main.c:550)): restarting: 0, norestore: 0
> 
> /usr/local/bin/wmaker(main(main.c:552)): Arg 1 is --for-real=
> /usr/local/bin/wmaker(real_main(main.c:635)): Got --for-real=, set
> restarting = 1
> /usr/local/bin/wmaker(StartUp(startup.c:767)): restarting: 1, norestore: 0

Is there supposed to be a restart in here?

> # ------------------------------------------------------------------
> # 4. run: restarting wmaker from menu, then leaving
> /usr/local/bin/wmaker(main(main.c:550)): restarting: 0, norestore: 0
> 
> /usr/local/bin/wmaker(main(main.c:550)): restarting: 0, norestore: 0
> 
> /usr/local/bin/wmaker(main(main.c:552)): Arg 1 is --for-real
> /usr/local/bin/wmaker(real_main(main.c:632)): Got --for-real, set
> restarting = 0
> /usr/local/bin/wmaker(main(main.c:550)): restarting: 0, norestore: 0
> 
> /usr/local/bin/wmaker(main(main.c:552)): Arg 1 is --for-real=
> /usr/local/bin/wmaker(real_main(main.c:635)): Got --for-real=, set
> restarting = 1
> /usr/local/bin/wmaker(StartUp(startup.c:767)): restarting: 1, norestore: 0
> 
> /usr/local/bin/wmaker(main(main.c:550)): restarting: 0, norestore: 0
> 
> /usr/local/bin/wmaker(main(main.c:552)): Arg 1 is --for-real=
> /usr/local/bin/wmaker(real_main(main.c:635)): Got --for-real=, set
> restarting = 1
> /usr/local/bin/wmaker(StartUp(startup.c:767)): restarting: 1, norestore: 0

And two restarts in here?

I'm guessing not. Let's try the attached patch to see for sure.
diff --git a/src/event.c b/src/event.c
index 3bc3c40..3082e31 100644
--- a/src/event.c
+++ b/src/event.c
@@ -216,6 +216,7 @@ void DispatchEvent(XEvent * event)
 
                Shutdown(WSRestartPreparationMode);
                /* received SIGHUP */
+               wmessage("Calling Restart() in DispatchEvent!");
                Restart(NULL, True);
        } else if (WCHECK_STATE(WSTATE_NEED_REREAD)) {
                WCHANGE_STATE(WSTATE_NORMAL);
@@ -593,6 +594,7 @@ static void handleExtensions(XEvent * event)
                XRRUpdateConfiguration(event);
                WCHANGE_STATE(WSTATE_RESTARTING);
                Shutdown(WSRestartPreparationMode);
+               wmessage("Calling Restart() in handleExtensions!");
                Restart(NULL,True);
        }
 #endif
diff --git a/src/main.c b/src/main.c
index 9fc9976..498b4fe 100644
--- a/src/main.c
+++ b/src/main.c
@@ -287,6 +287,8 @@ void Restart(char *manager, Bool abortOnFailure)
        char *argv[MAX_RESTART_ARGS];
        int i;
 
+       wmessage("Called Restart()!");
+
        if (manager && manager[0] != 0) {
                prog = argv[0] = strtok(manager, " ");
                for (i = 1; i < MAX_RESTART_ARGS; i++) {
diff --git a/src/rootmenu.c b/src/rootmenu.c
index 9183380..b789801 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -246,6 +246,7 @@ static void shutdownCommand(WMenu * menu, WMenuEntry * 
entry)
 static void restartCommand(WMenu * menu, WMenuEntry * entry)
 {
        Shutdown(WSRestartPreparationMode);
+       wmessage("Calling Restart() in restartCommand!");
        Restart((char *)entry->clientdata, False);
        Restart(NULL, True);
 }

Reply via email to