-----BEGIN PGP SIGNED MESSAGE-----
The fix I developed to prevent FvwmButtons looping isn't in 2.0.44,
unfortunately; I came in this morning to find it doing just that.
In addition, a patch to enable FvwmButtons to recognize old-style
'SwallowModule' configuration lines also didn't make it.
(The signal handling patch for fvwm itself is there, though).
A patch to FvwmButtons suitable for 2.0.44 is attached.
Grant McDorman <grant_at_isgtec.com>
ISG Technologies, Inc.
http://www.isgtec.com
Mississauga, Ontario, Canada
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
iQBVAwUBMuTilkDmya2cFZ8ZAQGQHAH9HfSliKW528pcGt0ryLjQRMmp5yL7GbCW
cbmcwNf6uYh/qNjHIckN8Hhjz3N+Inl9KYziQHcUVrMCF07EyNQ2JA==
=myy0
-----END PGP SIGNATURE-----
*** FvwmButtons.c.orig Tue Jan 14 11:30:43 1997
--- FvwmButtons.c Tue Jan 21 10:29:13 1997
***************
*** 27,32 ****
--- 27,33 ----
#include <string.h>
#include <sys/wait.h>
#include <sys/time.h>
+ #include <sys/stat.h>
#if defined ___AIX || defined _AIX || defined __QNX__ || defined ___AIXV3 || d
efined AIXV3 || defined _SEQUENT_
#include <sys/select.h>
#endif
***************
*** 75,80 ****
--- 76,82 ----
/* ------------------------------ prototypes ------------------------------- *
/
void DeadPipe(int nonsense);
+ void CleanUp(void);
void SetButtonSize(button_info*,int,int);
/* main */
void Loop(void);
***************
*** 123,128 ****
--- 125,132 ----
GC NormalGC;
int Width,Height;
+ int running = 1;
+
int x= -30000,y= -30000,w= -1,h= -1,gravity = NorthWestGravity;
int new_desk = 0;
int ready = 0;
***************
*** 170,182 ****
**/
void DeadPipe(int whatever)
{
button_info *b,*ub=UberButton;
int button=-1;
- signal(SIGPIPE, SIG_IGN);/* Xsync may cause SIGPIPE */
-
XSync(Dpy,0); /* Wait for thing to settle down a bit */
XGrabServer(Dpy); /* We don't want interference right now */
while(NextButton(&ub,&b,&button,0))
{
/* delete swallowed windows */
--- 174,217 ----
**/
void DeadPipe(int whatever)
{
+ struct stat buf;
+
+ /*
+ * If a SIGPIPE arrives during this operation, just exit.
+ * - the signal will probably because the server is shutting
+ * down. Attempting to do any further processing is useless
+ * and may in fact, on some platforms, put the process into
+ * a tight loop (if SIGPIPE is ignored).
+ * 22 July 1996 GRM.
+ *
+ * Further investigation: XSync may loop *without* causing a SIGPIPE.
+ * This may be because the connection is dead, or because of the
+ * fact that X operations in signal handlers are discouraged.
+ *
+ * In order to cover all the bases, then, this function will now
+ * set a global flag which will cause the main loop to stop.
+ *
+ * SIGPIPE is reset to DeadPipe, as well.
+ */
+ signal(SIGPIPE, DeadPipe);
+
+ /*
+ * Try to check status of X connection.
+ */
+ if (fstat(XConnectionNumber(Dpy), &buf) == -1)
+ exit(0);
+
+ running = 0;
+ }
+
+ void CleanUp(void)
+ {
button_info *b,*ub=UberButton;
int button=-1;
XSync(Dpy,0); /* Wait for thing to settle down a bit */
XGrabServer(Dpy); /* We don't want interference right now */
+
while(NextButton(&ub,&b,&button,0))
{
/* delete swallowed windows */
***************
*** 506,512 ****
int ex=10000,ey=10000,ex2=0,ey2=0;
#endif
! while(1)
{
if(My_XNextEvent(Dpy,&Event))
{
--- 541,547 ----
int ex=10000,ey=10000,ex2=0,ey2=0;
#endif
! while(running)
{
if(My_XNextEvent(Dpy,&Event))
{
***************
*** 733,738 ****
--- 768,774 ----
}
}
}
+ CleanUp();
}
/**
*** parse.c.orig Thu Jun 27 10:46:22 1996
--- parse.c Thu Jan 16 14:19:48 1997
***************
*** 670,675 ****
--- 670,679 ----
exit(1);
}
s+=7;
+ if (mystrncasecmp(s,"module",6)==0)
+ {
+ s+=6;
+ }
b->hangon=seekright(&s);
b->flags|=(b_Swallow|b_Hangon);
b->swallow|=1;
End of MIME message
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Tue Jan 21 1997 - 09:40:00 GMT