source: trunk/third/mwm/WmSignal.c @ 9757

Revision 9757, 2.4 KB checked in by ghudson, 28 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r9756, which included commits to RCS files with non-trunk default branches.
Line 
1/*
2 * (c) Copyright 1989, 1990, 1991, 1992 OPEN SOFTWARE FOUNDATION, INC.
3 * ALL RIGHTS RESERVED
4*/
5/*
6 * Motif Release 1.2
7*/
8#ifdef REV_INFO
9#ifndef lint
10static char rcsid[] = "$RCSfile: WmSignal.c,v $ $Revision: 1.1.1.1 $ $Date: 1997-03-25 09:12:26 $"
11#endif
12#endif
13/*
14 * (c) Copyright 1987, 1988, 1989, 1990 HEWLETT-PACKARD COMPANY */
15
16/*
17 * Included Files:
18 */
19
20#include <signal.h>
21#include "WmGlobal.h"
22
23/*
24 * include extern functions
25 */
26
27#include "WmFeedback.h"
28#include "WmFunction.h"
29
30
31/*
32 * Function Declarations:
33 */
34
35#ifdef _NO_PROTO
36void SetupWmSignalHandlers ();
37void QuitWmSignalHandler ();
38#else /* _NO_PROTO */
39void SetupWmSignalHandlers (int);
40void QuitWmSignalHandler (int);
41#endif /* _NO_PROTO */
42
43
44
45
46/*
47 * Global Variables:
48 */
49
50
51
52/*************************************<->*************************************
53 *
54 *  SetupWmSignalHandlers ()
55 *
56 *
57 *  Description:
58 *  -----------
59 *  This function sets up the signal handlers for the window manager.
60 *
61 *************************************<->***********************************/
62
63#ifdef _NO_PROTO
64void SetupWmSignalHandlers (dummy)
65    int dummy;
66#else /* _NO_PROTO */
67void SetupWmSignalHandlers (int dummy)
68#endif /* _NO_PROTO */
69{
70    void (*signalHandler) ();
71
72
73    signalHandler = (void (*)())signal (SIGINT, SIG_IGN);
74    if (signalHandler != (void (*)())SIG_IGN)
75    {
76        signal (SIGINT, QuitWmSignalHandler);
77    }
78
79    signalHandler = (void (*)())signal (SIGHUP, SIG_IGN);
80    if (signalHandler != (void (*)())SIG_IGN)
81    {
82        signal (SIGHUP, QuitWmSignalHandler);
83    }
84
85    signal (SIGQUIT, QuitWmSignalHandler);
86
87    signal (SIGTERM, QuitWmSignalHandler);
88
89
90} /* END OF FUNCTION SetupWmSignalHandlers */
91
92
93
94/*************************************<->*************************************
95 *
96 *  QuitWmSignalHandler ()
97 *
98 *
99 *  Description:
100 *  -----------
101 *  This function is called on receipt of a signal that is to terminate the
102 *  window manager.
103 *
104 *************************************<->***********************************/
105
106#ifdef _NO_PROTO
107void QuitWmSignalHandler (dummy)
108    int dummy;
109#else /* _NO_PROTO */
110void QuitWmSignalHandler (int dummy)
111#endif /* _NO_PROTO */
112{
113    if (wmGD.showFeedback & WM_SHOW_FB_KILL)
114    {
115        ConfirmAction (ACTIVE_PSD, QUIT_MWM_ACTION);
116        XFlush(DISPLAY);
117        SetupWmSignalHandlers(0);        /* dummy paramater */
118    }
119    else
120    {
121        Do_Quit_Mwm(False);
122    }
123
124} /* END OF FUNCTION QuitWmSignalHandler */
Note: See TracBrowser for help on using the repository browser.