2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: WmRestart.c /main/5 1996/05/20 16:08:04 drk $
25 * (c) Copyright 1996 Digital Equipment Corporation.
26 * (c) Copyright 1991,1993,1994,1996 Hewlett-Packard Company.
27 * (c) Copyright 1993,1994,1996 International Business Machines Corp.
28 * (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
29 * (c) Copyright 1993,1994,1996 Novell, Inc.
30 * (c) Copyright 1996 FUJITSU LIMITED.
31 * (c) Copyright 1996 Hitachi.
34 /************************************<+>*************************************
35 ****************************************************************************
39 ** Project: HP DT Workspace Manager
41 ** Description: Request restart of the HP DT workspace manager
43 ****************************************************************************
44 ************************************<+>*************************************/
47 #include <X11/Xutil.h>
48 #include <X11/Xatom.h>
52 #include <Xm/AtomMgr.h>
56 /*************************************<->*************************************
58 * _DtWmRestart (display, root)
63 * Request the window manager to restart
69 * root - root window of screen
73 * Success if request sent
75 *************************************<->***********************************/
77 _DtWmRestart (Display *display, Window root)
83 * Get the workspace manager window
85 if ((rval=_DtGetMwmWindow (display, root, &wmWindow)) == Success)
89 * Make the request by appending the restart request
90 * name to the _DT_WM_REQUEST property
93 rval = XChangeProperty (display, wmWindow,
94 XmInternAtom(display, _XA_DT_WM_REQUEST, False),
95 XA_STRING, 8, PropModeAppend,
96 (unsigned char *)DTWM_REQ_RESTART,
97 1+strlen(DTWM_REQ_RESTART));
99 XFlush (display); /* do it now */
105 } /* END OF FUNCTION _DtWmRestart */
108 /*************************************<->*************************************
110 * int _DtWmRestartNoConfirm (display, root)
115 * Request the window manager to restart with no confirmation dialog
121 * root - root window of screen
125 * Success if request sent
127 *************************************<->***********************************/
129 _DtWmRestartNoConfirm (Display *display, Window root)
136 * Make the request by appending the restart request
137 * name to the _DT_WM_REQUEST property
140 strcpy (&buffer[0], DTWM_REQ_RESTART);
141 strcat (&buffer[0], " ");
142 strcat (&buffer[0], DTWM_REQP_NO_CONFIRM);
145 * Get the workspace manager window
147 if ((rval=_DtGetMwmWindow (display, root, &wmWindow)) == Success)
150 * Make the request by appending the restart request
151 * name to the _DT_WM_REQUEST property
154 rval = XChangeProperty (display, wmWindow,
155 XmInternAtom(display, _XA_DT_WM_REQUEST, False),
156 XA_STRING, 8, PropModeAppend,
157 (unsigned char *)buffer,
160 XFlush (display); /* do it now */
165 } /* END OF FUNCTION _DtWmRestartNoConfirm */