2
// -------------------------------------------
4
// $Date: 2003/06/23 14:47:22 $
5
// $Revision: 1.1.1.1 $
6
// $Source: /cvsroot/miwm/miwm/miwm/error.cc,v $
7
// $Id: error.cc,v 1.1.1.1 2003/06/23 14:47:22 bwise837 Exp $
8
// $RCSfile: error.cc,v $
9
// -------------------------------------------
10
// Copyright by Ben Paul Wise.
11
// -------------------------------------------
12
// This program is free software; you can redistribute it and/or modify
13
// it under the terms of the GNU General Public License as published by
14
// the Free Software Foundation; either version 2 of the License, or
15
// (at your option) any later version.
17
// This program is distributed in the hope that it will be useful,
18
// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
// GNU General Public License for more details.
22
// You should have received a copy of the GNU General Public License
23
// along with this program; if not, write to the Free Software
24
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25
// -------------------------------------------
32
#include <X11/Xutil.h>
33
#include <X11/Xproto.h>
42
fprintf(stderr, "%s: %s\n", argv0, s);
44
cout << "Terminating MIWM at ";
45
cout << __TIME__<<", "<<__DATE__<<endl<<flush;
47
StopMemoryLeakCheck();
53
ErrorHandler(Display *d, XErrorEvent *e)
59
if (theWM->mode == wmStartup &&
60
e->request_code == X_ChangeWindowAttributes &&
61
e->error_code == BadAccess)
62
miAbort("another window manager is already running.");
64
if (ignore_badwindow &&
65
(e->error_code == BadWindow || e->error_code == BadColor))
68
XGetErrorText(d, e->error_code, msg, sizeof(msg));
69
sprintf(number, "%d", e->request_code);
70
XGetErrorDatabaseText(d, "XRequest", number, number, req, sizeof(req));
72
fprintf(stderr, "%s: protocol request %s on resource %#x failed: %s\n\n",
73
argv0, req, (unsigned int) e->resourceid, msg);
75
if (theWM->mode == wmStartup)
76
miAbort("Failed during initialization.");
81
// -------------------------------------------
83
// -------------------------------------------