Subject: Re: Notification: incoming/287

From: Tim Phipps <[email-masked]>
Date: Thu, 15 Apr 1999 09:53:59 +0100

Dominik Vogt wrote:
> 
> Hi Tim,
> 
> did you see this mail? I think you were the one that made the
> changes here. Do you know what to do here?

I don't know why I didn't notice this, must have been not paying
attention.  I thought npipes was set to the largest modules pipe
number.  I think it still works though even though npipes is set to a
fixed number.

What the code is testing for is for any module that was started during
startup.  These modules have a corresponding bit set in init_fdset. In
the present code:

       for(i=0;i<npipes;i++)
         if (FD_ISSET(i, &init_fdset))
           break;
       if (i == npipes)
         StartupStuff();

As soon as the first set bit is found in init_fdset the loop is
terminated and "i" will be set to the number of the first set bit i.e.
it will not be equal to npipes, the biggest it could be is (npipes -
1).  It could be rewritten:

       Bool none_left = True;
       for(i=0;i<npipes;i++)
         if (FD_ISSET(i, &init_fdset))
           none_left = False;
       if (none_left)
         StartupStuff();

or

       if (all_zeroes(&init_fdset, GetFdWidth()))
         StartupStuff();

but I don't think there is an all_zeroes function that works on
FD_SETSIZE structures. I suppose you could use a memcmp() with an empty
area.

> I don't know exactly what this is supposed to do, but startup
> is only completed when the if-condition is true. Which is the
> case if FD_ISSER returns zero for npipes pipes. Since npipes

Correct, the is an FD_ZERO(&init_fdset) before any modules are started,
an FD_SET(i, &init_fdset) for every module started during startup, and
an FD_CLR(i, &init_fdset) whenever a module quits.

> case if FD_ISSER returns zero for npipes pipes. Since npipes
> is a constant (256 on my system), the conition will be fulfilled
> only if you started 256 modules.

No, it will be fulfilled when all the modules you started during fvwm's
startup have finished.  There is an annoyingly long timeout that
overrides this condition so fvwm will not lock up totally if you start a
permanent module during startup. You should not start any permanent
modules in your .fvwm2rc, you should use the
InitFunction/RestartFunction.

I really don't want to go back to the old way (start up after the first
file is read) because you end up having to do Recapture after Restart to
get your window decorations to work. I could change it to wait only for
modules started by the command line to finish, this would be bad only
for people who run FvwmCpp from inside their .fvwm2rc (speak up now if
you do).

Cheers,
Tim.
--
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: Thu, 15 Apr 1999 13:13:55 +0200

On Thu, Apr 15, 1999 at 09:53:59AM +0100, Tim Phipps wrote:
>...

Hm, if starting modules from the config file during startup we could
write a temporary complex function that records all attempts to start
modules and delays them until InitFunction is executed. Would that
solve the problem?

Bye

Dominik ^_^

-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [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: Tim Phipps <[email-masked]>
Date: Thu, 15 Apr 1999 12:40:58 +0100

> modules and delays them until InitFunction is executed. Would that

I'm not sure. I'll change it to only wait for modules started on the
command line which will have the same effect but will be a lot simpler
to implement.

Cheers,
Tim.

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 15 Apr 1999 13:58:50 +0200

> command line which will have the same effect but will be a lot simpler

I don't quite understand what 'started on the command line' means?

Bye

Dominik ^_^

---

From: Tim Phipps <[email-masked]>
Date: Thu, 15 Apr 1999 13:14:32 +0100

> I don't quite understand what 'started on the command line' means?

fvwm2 -f /usr/local/X11/etc/system.fvwmrc -cmd FvwmM4 ~/.fvwm/config.m4

FvwmM4 would be waited for so any style settings in config.m4 would
work, any modules started from system.fvwmrc would not be waited for.

Cheers,
Tim.