Enable continuing startup when there are errors in ...e_session-XXXXXX.

SVN revision: 10551
This commit is contained in:
Kim Woelders 2004-06-19 21:31:40 +00:00
parent 9c8f848a7f
commit e380847cec
5 changed files with 44 additions and 42 deletions

View File

@ -1792,19 +1792,15 @@ doMoveModeSet(EWin * edummy, const void *params)
{
EDBUG(6, "doMoveModeSet");
if (params)
{
Conf.movemode = atoi((char *)params);
}
Conf.movemode = atoi((char *)params);
else
{
Conf.movemode++;
if (Conf.movemode > 5)
Conf.movemode = 0;
}
Conf.movemode++;
#if !USE_IMLIB2
if ((prImlib_Context) && (Conf.movemode == 5))
Conf.movemode = 3;
#endif
if (Conf.movemode < 0 || Conf.movemode > 5)
Conf.movemode = 0;
autosave();
EDBUG_RETURN(0);
edummy = NULL;
@ -1815,17 +1811,11 @@ doResizeModeSet(EWin * edummy, const void *params)
{
EDBUG(6, "doResizeModeSet");
if (params)
{
Conf.resizemode = atoi((char *)params);
}
Conf.resizemode = atoi((char *)params);
else
{
Conf.resizemode++;
if (Conf.resizemode > 4)
Conf.resizemode = 0;
}
if (Conf.resizemode == 5)
Conf.resizemode = 3;
Conf.resizemode++;
if (Conf.resizemode < 0 || Conf.resizemode > 4)
Conf.resizemode = 0;
autosave();
EDBUG_RETURN(0);
edummy = NULL;

View File

@ -692,9 +692,13 @@ Config_Control(FILE * ConfigFile)
break;
case CONTROL_MOVEMODE:
Conf.movemode = i2;
if (Conf.movemode < 0 || Conf.movemode > 5)
Conf.movemode = 0;
break;
case CONTROL_RESIZEMODE:
Conf.resizemode = i2;
if (Conf.resizemode < 0 || Conf.resizemode > 4)
Conf.resizemode = 0;
break;
case CONTROL_GEOMINFOMODE:
Conf.geominfomode = i2;
@ -4244,23 +4248,25 @@ SaveUserControlConfig(FILE * autosavefile)
static void
RecoverUserConfig(void)
{
int save;
if (is_autosave)
{
/* Don't save settings if we restart or quit */
save = Conf.autosave;
Conf.autosave = 0;
AlertX(_("Recover system config?"), _("Yes, Attempt recovery"),
_("Restart and try again"), _("Quit and give up"),
_
("Enlightenment has encountered parsing errors in your autosaved\n"
"configuration.\n" "\n"
"This may be due to filing system errors, Minor bugs or "
"unforeseen\n" "system shutdowns.\n" "\n"
"Do you wish Enlightenment to recover its original system\n"
"configuration and try again?\n"));
Conf.autosave = 0;
MapUnmap(1);
if (Mode.wm.master && init_win_ext)
{
XKillClient(disp, init_win_ext);
init_win_ext = 0;
}
SessionExit("restart");
/* Allow settings to be saved if we continue */
Conf.autosave = save;
}
}

View File

@ -232,14 +232,15 @@ main(int argc, char **argv)
GotoDesktop(0);
CommsSetup();
CommsFindCommsWindow();
GrabX();
LoadGroups();
LoadSnapInfo();
GrabX();
MapUnmap(0);
UngrabX();
/* make all of our fallback classes */
SetupFallbackClasses();
UngrabX();
desks.desk[0].viewable = 0;
/* now we're going to load the configuration/theme */
@ -296,10 +297,6 @@ main(int argc, char **argv)
XSync(disp, False);
Mode.queue_up = DRAW_QUEUE_ENABLE;
/* hello! we don't have a resizemode of 5! */
if (Conf.resizemode == 5)
Conf.resizemode = 0;
/* of course, we have to set the cursors */
ec = FindItem("DEFAULT", 0, LIST_FINDBY_NAME, LIST_TYPE_ECURSOR);
if (ec)
@ -371,6 +368,10 @@ main(int argc, char **argv)
BackgroundsInit(); /* Start the background accounting */
/* Update pagers */
for (i = 0; i < Conf.desks.num; i++)
RedrawPagersForDesktop(i, 0);
/* The primary event loop */
for (;;)
WaitEvent();

View File

@ -448,15 +448,8 @@ autosave(void)
if (!isfile(GetGenericSMFile()))
Alert(_("There was an error saving your autosave data - filing\n"
"system problems.\n"));
/*
* if (strcmp(GetSMFile(), GetGenericSMFile()))
* {
* if (exists(GetGenericSMFile()))
* E_rm(GetGenericSMFile());
* symlink(GetSMFile(), GetGenericSMFile());
* }
*/
}
#if 0 /* Why nuke it? */
else
{
/* char buf[1024];
@ -468,6 +461,7 @@ autosave(void)
Eprintf("autosave: kill %s\n", GetGenericSMFile());
E_rm(GetGenericSMFile());
}
#endif
}
#ifdef HAVE_X11_SM_SMLIB_H
@ -996,9 +990,16 @@ doSMExit(const void *params)
SaveSession(1);
ICCCM_SetEInfoOnAll();
EwinsSetFree();
if (Mode.wm.startup && Mode.wm.exiting)
MapUnmap(1);
if (disp)
XSelectInput(disp, VRoot.win, 0);
{
XSelectInput(disp, VRoot.win, 0);
if (Mode.wm.master && init_win_ext)
XKillClient(disp, init_win_ext);
}
if ((!params) || (!strcmp((char *)s, "exit")))
{

View File

@ -93,12 +93,16 @@ MapUnmap(int start)
}
else
{
AddToFamily(wlist[i]);
if (Mode.wm.exiting)
EMapWindow(disp, wlist[i]);
else
AddToFamily(wlist[i]);
}
}
}
}
XFree(wlist);
wlist = NULL;
}
break;
default: