Subject: InitFunc spawns new applications during a restart

From: Dominik Vogt <[email-masked]>
Date: Sat, 22 May 1999 05:29:00 +0200

With current CVS code my InitFunc is executed on every restart of
fvwm. I.e. after three restarts I have twelve running rxvt's instead
of the three I'm used too.

Bye

Dominik ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Matthias Clasen <[email-masked]>
Date: Sat, 22 May 1999 23:02:22 +0200

Sorry, I  can reproduce neither this nor any moving windows, icons
or viewports when restarting. I have tried it with and without a
session manager running. For me, restarting just works...
It would be interesting to know the cmdline args handed over to
the restarting instance of fvwm. Does the old instance create
a proper ~/.fvwm_restart file ?

Matthias

-- 
Matthias Clasen, 
Tel. 0761/203-5606
Email: [email-masked]
Mathematisches Institut, Albert-Ludwigs-Universitaet Freiburg
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 24 May 1999 14:49:16 +0200

> a proper ~/.fvwm_restart file ?

[final analysis]

There are two problems:

 1) The ~/.fvwm_restart file isn't generated. This is because
    'command' is an empty string (*not* a NULL pointer) and thus

     if (!command || strstr (command, "fvwm"))
       {
         RestartInSession (filename); /* won't return under SM */
       }

    is not true and hence no file is generated. This problem can
    be solved by adding

     else
       {
         /* create an empty file */
         FILE *f = fopen (filename, "w");
         fclose (f); /* return and let Done restart us */
       }

 2) fvwm is restarted without '-restore ~/.fvwm_restart'. The
    reason is again that I called Restart without parameters.
    '-restore ...' is added to my_argv, but then this is executed:

      if (command)
        execvp(command,my_argv);

    But command is still an empty string. So as a fallback the
    original startup line is executed with the original parameters
    which don't have the '-restore ...'. So fvwm thinks it is
    started for the first time and calls InitFunc.

BTW, are you *sure* that

  char *my_argv[10];

is big enough? I think you can add the '-cmd' option ten times
not to speak of the other options. We should really use dynamically
allocated memory.

Another question: Is using files to store this temporary information
the right way? If something goes wrong this will screw up fvwm. Wouldn't
it be better to set properties on the X server? This would prevent you
from restarting fvwm on a different X server though.

Bye

Dominik ^_^