FVWM: fvwm 2.0.46: patches and bugs

From: Grant McDorman <grant_at_isgtec.com>
Date: Tue, 26 Aug 1997 14:31:02 -0400 (EDT)

-----BEGIN PGP SIGNED MESSAGE-----

I have just finished installing - and patching - 2.0.46.

The patches (attached) are as follows:
   modules:
      FvwmWinList: do not call ShutMeDown in DeadPipe, just exit (to avoid
                    FvwmWinList looping)
      FvwmAudio: ditto
      FvwmIconBox: ditto, may need more work if the XDeleteProperty is needed
      FvwmIconMan: ditto
      FvwmButtons: do not do X calls in signal handling; also, allow
                    "swallowmodule" as well as "swallow" in FvwmGoodStuff
                    compatiblity [this patch previously submitted against
                    2.0.43]

   fvwm:
     colormaps.c: If, on Sun systems, TRUECOLOR_ALWAYS_INSTALLED is defined,
                  do not install a 24-bit TrueColor colormap. (Despite what
                  the server says, it is always installed.)
     add_window.c: Instead of doing button grabs for click-to-focus using no
                  modifiers and Caps Lock, use AnyModifer
     events.c: Button press handing: Check for user-defined button action
                  first, then allow click-to-focus/click-to-raise with any
                  modifier.
     placement.c: If a transient has no position specified, fall back to
                  random/smart placement (as per configuration) instead of
                  placing the transient at 0,0

   extras:
     FvwmTaskBar: fixes for signal handling like those above

Other "extras" programs require fixes for signal handling, including (at least)
FvwmWharf. If these programs are not fixed, they can go into a loop when fvwm
is terminated or the X server reset (i.e. logout). I would suggest these
programs be removed from the release, or at least have a very strong warning
attached, until they are fixed.


Grant McDorman <grant_at_isgtec.com>
ISG Technologies, Inc. http://www.isgtec.com
Mississauga, Ontario, Canada


-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQBVAwUBNAMg5UDmya2cFZ8ZAQEiOAIAuWYub8sUblDwYN5GkyL3NoYc1wtq0gVI
559BZRWU6ehBzj+CWv9Ih/YitA6IVT8JVOtmobpAHxWFHeMlbIhjig==
=ikmu
-----END PGP SIGNATURE-----


*** fvwm-2.0.46/modules/FvwmWinList/FvwmWinList.c.orig Wed Aug 6 16:19:28 1997
--- fvwm-2.0.46/modules/FvwmWinList/FvwmWinList.c Tue Aug 26 11:56:22 1997
***************
*** 457,463 ****
   **********************************************************************/
  void DeadPipe(int nonsense)
  {
! ShutMeDown(1);
  }
  
  /*****************************************************************************
*
--- 457,467 ----
   **********************************************************************/
  void DeadPipe(int nonsense)
  {
! /*
! * do not call ShutMeDown, it may make X calls which are not allowed
! * in a signal hander.
! */
! exit(1);
  }
  
  /*****************************************************************************
*
*** fvwm-2.0.46/modules/FvwmAudio/FvwmAudio.c.orig Fri Jan 17 11:10:49 1997
--- fvwm-2.0.46/modules/FvwmAudio/FvwmAudio.c Tue Aug 26 11:48:53 1997
***************
*** 469,474 ****
--- 469,479 ----
   ***********************************************************************/
  void DeadPipe(int nonsense)
  {
+ /*
+ * In most cases, the only legal operation here is to exit. However,
+ * for this module done(0) is acceptable since all done does is
+ * to play an audio sample [see below].
+ */
          done(0);
  }
  
*** fvwm-2.0.46/modules/FvwmIconBox/FvwmIconBox.c.orig Thu Jan 2 15:19:31 1997
--- fvwm-2.0.46/modules/FvwmIconBox/FvwmIconBox.c Tue Aug 26 11:51:38 1997
***************
*** 1419,1427 ****
      tmpi = tmpi->next;
      freeitem(tmpi2, 0);
    }
! if ((local_flags & SETWMICONSIZE))
! XDeleteProperty(dpy, Root, XA_WM_ICON_SIZE);
! XSync(dpy,0);
    exit(0);
  }
  
--- 1419,1431 ----
      tmpi = tmpi->next;
      freeitem(tmpi2, 0);
    }
! /*
! * This cannot be done in a signal handler.
! */
! /* if ((local_flags & SETWMICONSIZE))
! * XDeleteProperty(dpy, Root, XA_WM_ICON_SIZE);
! * XSync(dpy,0);
! */
    exit(0);
  }
  
*** fvwm-2.0.46/modules/FvwmButtons/FvwmButtons.c.orig Thu Jun 26 17:32:31 1997
--- fvwm-2.0.46/modules/FvwmButtons/FvwmButtons.c Tue Aug 26 11:46:29 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
***************
*** 78,83 ****
--- 79,85 ----
  /* ------------------------------ prototypes ------------------------------- *
/
  
  void DeadPipe(int nonsense);
+ void CleanUp(void);
  void SetButtonSize(button_info*,int,int);
  /* main */
  void Loop(void);
***************
*** 126,131 ****
--- 128,135 ----
  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;
***************
*** 173,185 ****
  **/
  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 */
--- 177,220 ----
  **/
  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 */
***************
*** 587,593 ****
    int ex=10000,ey=10000,ex2=0,ey2=0;
  #endif
  
! while(1)
      {
        if(My_XNextEvent(Dpy,&Event))
          {
--- 622,628 ----
    int ex=10000,ey=10000,ex2=0,ey2=0;
  #endif
  
! while(running)
      {
        if(My_XNextEvent(Dpy,&Event))
          {
***************
*** 814,819 ****
--- 849,855 ----
            }
        }
      }
+ CleanUp();
  }
  
  /**
*** fvwm-2.0.46/modules/FvwmButtons/parse.c.orig Thu Jun 26 17:32:33 1997
--- fvwm-2.0.46/modules/FvwmButtons/parse.c Tue Aug 26 11:44:18 1997
***************
*** 670,675 ****
--- 670,682 ----
            exit(1);
          }
        s+=7;
+ /*
+ * Swallow old 'swallowmodule' command
+ */
+ if (mystrncasecmp(s,"module",6)==0)
+ {
+ s+=6;
+ }
        b->hangon=seekright(&s);
        b->flags|=(b_Swallow|b_Hangon);
        b->swallow|=1;
*** fvwm-2.0.46/modules/FvwmIconMan/FvwmIconMan.c.orig Wed Jul 16 21:31:21 1997
--- fvwm-2.0.46/modules/FvwmIconMan/FvwmIconMan.c Tue Aug 26 11:53:22 1997
***************
*** 96,102 ****
  void DeadPipe (int nothing)
  {
    ConsoleDebug (CORE, "Bye Bye\n");
! ShutMeDown (0);
  }
  
  void SendFvwmPipe (char *message,unsigned long window)
--- 96,107 ----
  void DeadPipe (int nothing)
  {
    ConsoleDebug (CORE, "Bye Bye\n");
! /*
! * ShutMeDown is not called because most operations, especially X
! * calls, are not allowed in signal handlers. Currently, of course,
! * ShutMeDown doesn't do anything significant, but it may in future.
! */
! exit (0);
  }
  
  void SendFvwmPipe (char *message,unsigned long window)
*** fvwm-2.0.46/fvwm/colormaps.c.orig Fri Apr 28 08:38:32 1995
--- fvwm-2.0.46/fvwm/colormaps.c Tue Aug 26 12:03:50 1997
***************
*** 152,159 ****
            if(w == tmp->w)
              ThisWinInstalled = True;
            XGetWindowAttributes(dpy,w,&attributes);
!
! if(last_cmap != attributes.colormap)
              {
                last_cmap = attributes.colormap;
                XInstallColormap(dpy,attributes.colormap);
--- 152,168 ----
            if(w == tmp->w)
              ThisWinInstalled = True;
            XGetWindowAttributes(dpy,w,&attributes);
!
! /*
! * On Sun X servers, don't install 24 bit TrueColor colourmaps.
! * Despite what the server says, these colourmaps are always
! * installed.
! */
! if(last_cmap != attributes.colormap
! #if defined(sun) && defined(TRUECOLOR_ALWAYS_INSTALLED)
! && !(attributes.depth == 24 && attributes.visual->class == TrueCo
lor)
! #endif
! )
              {
                last_cmap = attributes.colormap;
                XInstallColormap(dpy,attributes.colormap);
***************
*** 163,169 ****
  
    if(!ThisWinInstalled)
      {
! if(last_cmap != tmp->attr.colormap)
          {
            last_cmap = tmp->attr.colormap;
            XInstallColormap(dpy,tmp->attr.colormap);
--- 172,182 ----
  
    if(!ThisWinInstalled)
      {
! if(last_cmap != tmp->attr.colormap
! #if defined(sun) && defined(TRUECOLOR_ALWAYS_INSTALLED)
! && !(attributes.depth == 24 && attributes.visual->class == TrueColor)
! #endif
! )
          {
            last_cmap = tmp->attr.colormap;
            XInstallColormap(dpy,tmp->attr.colormap);
*** fvwm-2.0.46/fvwm/add_window.c.orig Wed Aug 6 15:35:12 1997
--- fvwm-2.0.46/fvwm/add_window.c Tue Aug 26 11:25:56 1997
***************
*** 656,667 ****
        for(i=0;i<3;i++)
          if(Scr.buttons2grab & (1<<i))
            {
! XGrabButton(dpy,(i+1),0,tmp_win->frame,True,
! ButtonPressMask, GrabModeSync,GrabModeAsync,None,
! Scr.FvwmCursors[SYS]);
! XGrabButton(dpy,(i+1),LockMask,tmp_win->frame,True,
                          ButtonPressMask, GrabModeSync,GrabModeAsync,None,
                          Scr.FvwmCursors[SYS]);
            }
      }
    BroadcastConfig(M_ADD_WINDOW,tmp_win);
--- 656,669 ----
        for(i=0;i<3;i++)
          if(Scr.buttons2grab & (1<<i))
            {
! /* accept any modifier on this button */
! XGrabButton(dpy,(i+1),AnyModifier,tmp_win->frame,True,
                          ButtonPressMask, GrabModeSync,GrabModeAsync,None,
                          Scr.FvwmCursors[SYS]);
+ /* XGrabButton(dpy,(i+1),LockMask,tmp_win->frame,True,
+ * ButtonPressMask, GrabModeSync,GrabModeAsync,None,
+ * Scr.FvwmCursors[SYS]);
+ */
            }
      }
    BroadcastConfig(M_ADD_WINDOW,tmp_win);
*** fvwm-2.0.46/fvwm/decorations.c.orig Mon Aug 4 16:52:51 1997
--- fvwm-2.0.46/fvwm/decorations.c Tue Aug 26 11:29:57 1997
***************
*** 589,594 ****
--- 589,598 ----
       (!(t->functions & MWM_FUNC_CLOSE)))
      return 0;
  
+ if((function == F_CLOSE)&&(t)&&
+ (!(t->functions & MWM_FUNC_CLOSE)))
+ return 0;
+
    if((function == F_DESTROY)&&(t)&&
       (!(t->functions & MWM_FUNC_CLOSE)))
      return 0;
*** fvwm-2.0.46/fvwm/events.c.orig Thu Aug 7 11:14:22 1997
--- fvwm-2.0.46/fvwm/events.c Tue Aug 26 12:13:14 1997
***************
*** 968,1035 ****
    
    DBUG("HandleButtonPress","Routine Entered");
  
! /* click to focus stuff goes here */
! if((Tmp_win)&&(Tmp_win->flags & ClickToFocus)&&(Tmp_win != Scr.Ungrabbed) &&
! ((Event.xbutton.state&
! (ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) == 0))
    {
! if(Tmp_win)
      {
! SetFocus(Tmp_win->w,Tmp_win,1);
  /* #ifdef CLICKY_MODE_1 */
! if (Scr.ClickToFocusRaises ||
! ((Event.xany.window != Tmp_win->w)&&
! (Event.xbutton.subwindow != Tmp_win->w)&&
! (Event.xany.window != Tmp_win->Parent)&&
! (Event.xbutton.subwindow != Tmp_win->Parent)))
  /* #endif */
! {
! RaiseWindow(Tmp_win);
! }
        
! KeepOnTop();
  
        /* Why is this here? Seems to cause breakage with
         * non-focusing windows! */
! if(!(Tmp_win->flags & ICONIFIED))
! {
! XSync(dpy,0);
! /* pass click event to just clicked to focus window? */
! if (Scr.ClickToFocusPassesClick)
! XAllowEvents(dpy,ReplayPointer,CurrentTime);
! else /* don't pass click to just focused window */
! XAllowEvents(dpy,AsyncPointer,CurrentTime);
! XSync(dpy,0);
! return;
! }
        
      }
! }
! else if ((Tmp_win) && !(Tmp_win->flags & ClickToFocus) &&
! (Event.xbutton.window == Tmp_win->frame) &&
! Scr.MouseFocusClickRaises)
! {
! if (Tmp_win != Scr.LastWindowRaised &&
! (Event.xbutton.state &
! (ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) == 0 &&
! GetContext(Tmp_win,&Event, &PressedW) == C_WINDOW)
      {
! RaiseWindow(Tmp_win);
! KeepOnTop();
      }
- XSync(dpy,0);
- XAllowEvents(dpy,ReplayPointer,CurrentTime);
- XSync(dpy,0);
- return;
    }
  
- XSync(dpy,0);
- XAllowEvents(dpy,ReplayPointer,CurrentTime);
- XSync(dpy,0);
-
- Context = GetContext(Tmp_win,&Event, &PressedW);
- LocalContext = Context;
- x= PressedW;
    if(Context == C_TITLE)
      SetTitleBar(Tmp_win,(Scr.Hilite == Tmp_win),False);
    else
--- 968,1058 ----
    
    DBUG("HandleButtonPress","Routine Entered");
  
! /*
! * First, look for button bindings.
! */
! Context = GetContext(Tmp_win,&Event, &PressedW);
! LocalContext = Context;
! x= PressedW;
!
! /* we have to execute a function or pop up a menu
! */
!
! modifier = (Event.xbutton.state & mods_used);
! /* need to search for an appropriate mouse binding */
! for (MouseEntry = Scr.AllBindings; MouseEntry != NULL;
! MouseEntry= MouseEntry->NextBinding)
    {
! if(((MouseEntry->Button_Key == Event.xbutton.button)||
! (MouseEntry->Button_Key == 0))&&
! (MouseEntry->Context & Context)&&
! ((MouseEntry->Modifier == AnyModifier)||
! (MouseEntry->Modifier == (modifier& (~LockMask))))&&
! (MouseEntry->IsMouse == 1))
      {
! /* got a match ... save it and exit loop */
! break;
! }
! }
!
! /*
! * do no click to focus if a mouse function was found
! */
! if (MouseEntry == NULL) {
! /* click to focus stuff goes here */
! /* any modifier is acceptable for click-to-focus */
! if((Tmp_win)&&(Tmp_win->flags & ClickToFocus)&&(Tmp_win != Scr.Ungrabbed))
! {
! if(Tmp_win)
! {
! SetFocus(Tmp_win->w,Tmp_win,1);
  /* #ifdef CLICKY_MODE_1 */
! if (Scr.ClickToFocusRaises ||
! ((Event.xany.window != Tmp_win->w)&&
! (Event.xbutton.subwindow != Tmp_win->w)&&
! (Event.xany.window != Tmp_win->Parent)&&
! (Event.xbutton.subwindow != Tmp_win->Parent)))
  /* #endif */
! {
! RaiseWindow(Tmp_win);
! }
        
! KeepOnTop();
  
        /* Why is this here? Seems to cause breakage with
         * non-focusing windows! */
! if(!(Tmp_win->flags & ICONIFIED))
! {
! XSync(dpy,0);
! /* pass click event to just clicked to focus window? */
! if (Scr.ClickToFocusPassesClick)
! XAllowEvents(dpy,ReplayPointer,CurrentTime);
! else /* don't pass click to just focused window */
! XAllowEvents(dpy,AsyncPointer,CurrentTime);
! XSync(dpy,0);
! return;
! }
        
+ }
      }
! else if ((Tmp_win) && !(Tmp_win->flags & ClickToFocus) &&
! (Event.xbutton.window == Tmp_win->frame) &&
! Scr.MouseFocusClickRaises)
      {
! /* click-to-raise. Again, ignore any modifiers. */
! if (Tmp_win != Scr.LastWindowRaised &&
! GetContext(Tmp_win,&Event, &PressedW) == C_WINDOW)
! {
! RaiseWindow(Tmp_win);
! KeepOnTop();
! }
! XSync(dpy,0);
! XAllowEvents(dpy,ReplayPointer,CurrentTime);
! XSync(dpy,0);
! return;
      }
    }
  
    if(Context == C_TITLE)
      SetTitleBar(Tmp_win,(Scr.Hilite == Tmp_win),False);
    else
***************
*** 1037,1062 ****
    
    ButtonWindow = Tmp_win;
    
! /* we have to execute a function or pop up a menu
! */
!
! modifier = (Event.xbutton.state & mods_used);
! /* need to search for an appropriate mouse binding */
! for (MouseEntry = Scr.AllBindings; MouseEntry != NULL;
! MouseEntry= MouseEntry->NextBinding)
! {
! if(((MouseEntry->Button_Key == Event.xbutton.button)||
! (MouseEntry->Button_Key == 0))&&
! (MouseEntry->Context & Context)&&
! ((MouseEntry->Modifier == AnyModifier)||
! (MouseEntry->Modifier == (modifier& (~LockMask))))&&
! (MouseEntry->IsMouse == 1))
! {
! /* got a match, now process it */
        ExecuteFunction(MouseEntry->Action,Tmp_win, &Event,Context,-1);
! break;
! }
! }
    PressedW = None;
    if(LocalContext!=C_TITLE)
      SetBorder(ButtonWindow,(Scr.Hilite == ButtonWindow),True,True,x);
--- 1060,1072 ----
    
    ButtonWindow = Tmp_win;
    
! XSync(dpy,0);
! XAllowEvents(dpy,ReplayPointer,CurrentTime);
! XSync(dpy,0);
!
! if (MouseEntry != NULL)
        ExecuteFunction(MouseEntry->Action,Tmp_win, &Event,Context,-1);
!
    PressedW = None;
    if(LocalContext!=C_TITLE)
      SetBorder(ButtonWindow,(Scr.Hilite == ButtonWindow),True,True,x);
*** fvwm-2.0.46/fvwm/placement.c.orig Fri Jan 17 09:39:21 1997
--- fvwm-2.0.46/fvwm/placement.c Tue Aug 26 14:24:49 1997
***************
*** 396,402 ****
    /* Desk has been selected, now pick a location for the window */
    /*
     * If
! * o the window is a transient, or
     *
     * o a USPosition was requested
     *
--- 396,402 ----
    /* Desk has been selected, now pick a location for the window */
    /*
     * If
! * o the window is a transient with a position, or
     *
     * o a USPosition was requested
     *
***************
*** 405,411 ****
     * If RandomPlacement was specified,
     * then place the window in a psuedo-random location
     */
! if (!(tmp_win->flags & TRANSIENT) &&
        !(tmp_win->hints.flags & USPosition) &&
        ((tflag & NO_PPOSITION_FLAG)||
         !(tmp_win->hints.flags & PPosition)) &&
--- 405,411 ----
     * If RandomPlacement was specified,
     * then place the window in a psuedo-random location
     */
! if (!((tmp_win->flags & TRANSIENT) && (tmp_win->hints.flags & PPosition)) &&
        !(tmp_win->hints.flags & USPosition) &&
        ((tflag & NO_PPOSITION_FLAG)||
         !(tmp_win->hints.flags & PPosition)) &&
***************
*** 415,421 ****
          (tmp_win->wmhints->initial_state == IconicState)) )
    {
      /* Get user's window placement, unless RandomPlacement is specified */
! if(tflag & RANDOM_PLACE_FLAG)
      {
        if(tflag & SMART_PLACE_FLAG)
          SmartPlacement(tmp_win,tmp_win->frame_width+2*tmp_win->bw,
--- 415,421 ----
          (tmp_win->wmhints->initial_state == IconicState)) )
    {
      /* Get user's window placement, unless RandomPlacement is specified */
! if(tflag & RANDOM_PLACE_FLAG || (tmp_win->flags & TRANSIENT))
      {
        if(tflag & SMART_PLACE_FLAG)
          SmartPlacement(tmp_win,tmp_win->frame_width+2*tmp_win->bw,
*** fvwm-2.0.46/extras/FvwmTaskBar/FvwmTaskBar.c.orig Tue Sep 24 06:54:59 1996
--- fvwm-2.0.46/extras/FvwmTaskBar/FvwmTaskBar.c Tue Aug 26 13:59:45 1997
***************
*** 78,83 ****
--- 78,90 ----
  int Fvwm_fd[2];
  int x_fd;
  
+ /* Signal handling */
+ int signal_pipes[2];
+ enum e_SignalActions {
+ SIGNAL_DEAD_PIPE=1,
+ SIGNAL_ALARM=2
+ };
+
  /* X related things */
  Display *dpy;
  Window Root, win;
***************
*** 181,188 ****
    Fvwm_fd[1] = atoi(argv[2]);
    fd_width = GetFdWidth();
  
    signal (SIGPIPE, DeadPipe);
! signal (SIGALRM, Alarm);
  
    SetMessageMask(Fvwm_fd,M_ADD_WINDOW | M_CONFIGURE_WINDOW | M_DESTROY_WINDOW
|
                   M_WINDOW_NAME | M_ICON_NAME | M_RES_NAME | M_DEICONIFY | M_ICONIFY |
--- 188,197 ----
    Fvwm_fd[1] = atoi(argv[2]);
    fd_width = GetFdWidth();
  
+ /* set up signal and alarm pipes */
+ pipe(signal_pipes);
    signal (SIGPIPE, DeadPipe);
! signal (SIGALRM, SigAlarm);
  
    SetMessageMask(Fvwm_fd,M_ADD_WINDOW | M_CONFIGURE_WINDOW | M_DESTROY_WINDOW
|
                   M_WINDOW_NAME | M_ICON_NAME | M_RES_NAME | M_DEICONIFY | M_ICONIFY |
***************
*** 281,286 ****
--- 290,311 ----
        DrawGoodies();
      }
  
+ /*
+ * signal notification handling
+ */
+ if (FD_ISSET(signal_pipes[1], &readset)) {
+ char buffer[1];
+ read(signal_pipes[1], buffer, sizeof buffer);
+ switch (buffer[0]) {
+ case SIGNAL_DEAD_PIPE:
+ ShutMeDown(1);
+ break;
+
+ case SIGNAL_ALARM:
+ Alarm();
+ }
+ }
+
    }
  }
  
***************
*** 495,502 ****
   **********************************************************************/
  void DeadPipe(int nonsense)
  {
! ConsoleMessage("received SIGPIPE signal: exiting...\n");
! ShutMeDown(1);
  }
  
  /*****************************************************************************
*
--- 520,530 ----
   **********************************************************************/
  void DeadPipe(int nonsense)
  {
! /*
! * Send notification to the main loop
! */
! static char buffer[1] = { (char) SIGNAL_DEAD_PIPE };
! write(signal_pipes[0], buffer, sizeof buffer);
  }
  
  /*****************************************************************************
*
***************
*** 717,725 ****
  /*****************************************************************************
*
    Alarm - Handle a SIGALRM - used to implement timeout events
  ******************************************************************************
/
! void Alarm(int nonsense) {
  
! switch(AlarmSet) {
  
    case SHOW_TIP:
      ShowTipWindow(1);
--- 745,763 ----
  /*****************************************************************************
*
    Alarm - Handle a SIGALRM - used to implement timeout events
  ******************************************************************************
/
! void SigAlarm(int nonsense) {
!
! /*
! * send an alarm to the main loop
! */
! static char buffer[1] = { (char) SIGNAL_ALARM };
! write(signal_pipes[0], buffer, sizeof buffer);
!
! signal (SIGALRM, SigAlarm);
! }
  
! void Alarm(void) {
! switch(AlarmSet) {
  
    case SHOW_TIP:
      ShowTipWindow(1);
***************
*** 731,737 ****
    }
  
    AlarmSet = NOT_SET;
- signal (SIGALRM, Alarm);
  }
  
  /*****************************************************************************
*
--- 769,774 ----

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 Aug 26 1997 - 13:32:24 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:38:00 BST