Don't exit while in X error handler.

SVN revision: 32933
This commit is contained in:
Kim Woelders 2007-12-02 11:15:57 +00:00
parent 6b1369f762
commit 4a7eb693c7
2 changed files with 14 additions and 15 deletions

View File

@ -185,20 +185,6 @@ HandleXError(Display * d __UNUSED__, XErrorEvent * ev)
{
char buf[64];
if ((ev->request_code == X_ChangeWindowAttributes)
&& (ev->error_code == BadAccess))
{
if (Mode.wm.xselect)
{
AlertX(_("Another Window Manager is already running"),
_("OK"), NULL, NULL,
_("Another Window Manager is already running.\n" "\n"
"You will have to quit your current Window Manager first before\n"
"you can successfully run Enlightenment.\n"));
EExit(1);
}
}
if (EDebug(1))
{
XGetErrorText(disp, ev->error_code, buf, 63);
@ -206,6 +192,11 @@ HandleXError(Display * d __UNUSED__, XErrorEvent * ev)
ev->resourceid, ev->error_code,
ev->request_code, ev->minor_code, buf);
}
if (Mode.wm.xselect &&
(ev->request_code == X_ChangeWindowAttributes) &&
(ev->error_code == BadAccess))
Mode.wm.xselect = 0;
}
void

View File

@ -159,7 +159,15 @@ SetupX(const char *dstr)
StructureNotifyMask | SubstructureNotifyMask | SubstructureRedirectMask;
ESelectInput(VRoot.win, mask);
ESync();
if (!Mode.wm.xselect)
{
AlertX(_("Another Window Manager is already running"),
_("OK"), NULL, NULL,
_("Another Window Manager is already running.\n" "\n"
"You will have to quit your current Window Manager first before\n"
"you can successfully run Enlightenment.\n"));
EExit(1);
}
Mode.wm.xselect = 0;
/* warn, if necessary about X version problems */