Wed Sep 22 13:37:41 PDT 1999

(Raster)

the remember dialog not coming up bug.. fixed.. :)

*should* have fixed soem multihead issues - have still to test..
(shoudl restart correctly, exit correcttly, restart anotherwm correctly and
restart themes correctly)


SVN revision: 369
This commit is contained in:
Carsten Haitzler 1999-09-22 20:05:33 +00:00
parent e7c67acde2
commit 9ccce39347
11 changed files with 135 additions and 114 deletions

View File

@ -2177,3 +2177,15 @@ Wed Sep 22 10:44:34 PDT 1999
(Raster)
update TODO
-------------------------------------------------------------------------------
Wed Sep 22 13:37:41 PDT 1999
(Raster)
the remember dialog not coming up bug.. fixed.. :)
*should* have fixed soem multihead issues - have still to test..
(shoudl restart correctly, exit correcttly, restart anotherwm correctly and
restart themes correctly)

View File

@ -1193,6 +1193,7 @@ typedef struct _emode
Window kde_dock;
int kde_support;
char clickalways;
char keybinds_changed;
}
EMode;

View File

@ -738,6 +738,7 @@ HandleComms(XEvent * ev)
int i, l;
char buf[FILEPATH_LEN_MAX], *sp, *ss;
mode.keybinds_changed = 1;
ac = (ActionClass *) RemoveItem("KEYBINDINGS", 0,
LIST_FINDBY_NAME,
LIST_TYPE_ACLASS_GLOBAL);

View File

@ -1943,8 +1943,12 @@ Config_ActionClass(FILE * ConfigFile)
case ACLASS_NAME:
ac = RemoveItem(s2, 0, LIST_FINDBY_NAME, LIST_TYPE_ACLASS);
if (!ac)
ac = RemoveItem(s2, 0,
LIST_FINDBY_NAME, LIST_TYPE_ACLASS_GLOBAL);
{
ac = RemoveItem(s2, 0,
LIST_FINDBY_NAME, LIST_TYPE_ACLASS_GLOBAL);
if (!strcmp(s2, "KEYBINDINGS"))
mode.keybinds_changed = 1;
}
if (ac)
RemoveActionClass(ac);
ac = CreateAclass(s2);
@ -3636,84 +3640,87 @@ SaveUserControlConfig(FILE * autosavefile)
fprintf(autosavefile, "1367 %i\n", (int)mode.clickalways);
fprintf(autosavefile, "1000\n");
fprintf(autosavefile, "1001 0\n");
ac = (ActionClass *) FindItem("KEYBINDINGS", 0,
LIST_FINDBY_NAME,
LIST_TYPE_ACLASS_GLOBAL);
if ((ac) && (ac->num > 0))
if (mode.keybinds_changed)
{
fprintf(autosavefile, "11 999\n");
fprintf(autosavefile, "100 %s\n", ac->name);
fprintf(autosavefile, "102 7\n");
for (i = 0; i < ac->num; i++)
ac = (ActionClass *) FindItem("KEYBINDINGS", 0,
LIST_FINDBY_NAME,
LIST_TYPE_ACLASS_GLOBAL);
if ((ac) && (ac->num > 0))
{
aa = ac->list[i];
if ((aa) && (aa->action) && (aa->event == EVENT_KEY_DOWN) &&
(aa->key_str))
fprintf(autosavefile, "11 999\n");
fprintf(autosavefile, "100 %s\n", ac->name);
fprintf(autosavefile, "102 7\n");
for (i = 0; i < ac->num; i++)
{
int mod;
aa = ac->list[i];
if ((aa) && (aa->action) && (aa->event == EVENT_KEY_DOWN) &&
(aa->key_str))
{
int mod;
/* next action */
if (i > 0)
fprintf(autosavefile, "105\n");
/* key */
fprintf(autosavefile, "427 %s\n", aa->key_str);
/* event */
fprintf(autosavefile, "428 4\n");
/* modifier */
mod = 0;
if (aa->modifiers == (ControlMask))
mod = 902;
else if (aa->modifiers == (Mod1Mask))
mod = 903;
else if (aa->modifiers == (Mod2Mask))
mod = 904;
else if (aa->modifiers == (Mod3Mask))
mod = 905;
else if (aa->modifiers == (Mod4Mask))
mod = 906;
else if (aa->modifiers == (Mod5Mask))
mod = 907;
else if (aa->modifiers == (ShiftMask))
mod = 900;
else if (aa->modifiers == (ControlMask | Mod1Mask))
mod = 910;
else if (aa->modifiers == (ShiftMask | ControlMask))
mod = 911;
else if (aa->modifiers == (ShiftMask | Mod1Mask))
mod = 912;
else if (aa->modifiers == (ShiftMask | ControlMask
| Mod1Mask))
mod = 913;
else if (aa->modifiers == (ControlMask | Mod4Mask))
mod = 914;
else if (aa->modifiers == (ShiftMask | Mod4Mask))
mod = 915;
else if (aa->modifiers == (ControlMask | ShiftMask
| Mod4Mask))
mod = 916;
else if (aa->modifiers == (ControlMask | Mod5Mask))
mod = 917;
else if (aa->modifiers == (ShiftMask | Mod5Mask))
mod = 918;
else if (aa->modifiers == (ControlMask | ShiftMask
| Mod5Mask))
mod = 919;
else if (aa->modifiers == (Mod2Mask | ShiftMask))
mod = 920;
else if (aa->modifiers == (Mod2Mask | ControlMask))
mod = 921;
else if (aa->modifiers == (Mod2Mask | Mod1Mask))
mod = 922;
fprintf(autosavefile, "101 %i\n", mod);
/* action */
if (aa->action->params)
fprintf(autosavefile, "104 %i %s\n", aa->action->Type,
(char *)aa->action->params);
else
fprintf(autosavefile, "104 %i\n", aa->action->Type);
/* next action */
if (i > 0)
fprintf(autosavefile, "105\n");
/* key */
fprintf(autosavefile, "427 %s\n", aa->key_str);
/* event */
fprintf(autosavefile, "428 4\n");
/* modifier */
mod = 0;
if (aa->modifiers == (ControlMask))
mod = 902;
else if (aa->modifiers == (Mod1Mask))
mod = 903;
else if (aa->modifiers == (Mod2Mask))
mod = 904;
else if (aa->modifiers == (Mod3Mask))
mod = 905;
else if (aa->modifiers == (Mod4Mask))
mod = 906;
else if (aa->modifiers == (Mod5Mask))
mod = 907;
else if (aa->modifiers == (ShiftMask))
mod = 900;
else if (aa->modifiers == (ControlMask | Mod1Mask))
mod = 910;
else if (aa->modifiers == (ShiftMask | ControlMask))
mod = 911;
else if (aa->modifiers == (ShiftMask | Mod1Mask))
mod = 912;
else if (aa->modifiers == (ShiftMask | ControlMask
| Mod1Mask))
mod = 913;
else if (aa->modifiers == (ControlMask | Mod4Mask))
mod = 914;
else if (aa->modifiers == (ShiftMask | Mod4Mask))
mod = 915;
else if (aa->modifiers == (ControlMask | ShiftMask
| Mod4Mask))
mod = 916;
else if (aa->modifiers == (ControlMask | Mod5Mask))
mod = 917;
else if (aa->modifiers == (ShiftMask | Mod5Mask))
mod = 918;
else if (aa->modifiers == (ControlMask | ShiftMask
| Mod5Mask))
mod = 919;
else if (aa->modifiers == (Mod2Mask | ShiftMask))
mod = 920;
else if (aa->modifiers == (Mod2Mask | ControlMask))
mod = 921;
else if (aa->modifiers == (Mod2Mask | Mod1Mask))
mod = 922;
fprintf(autosavefile, "101 %i\n", mod);
/* action */
if (aa->action->params)
fprintf(autosavefile, "104 %i %s\n", aa->action->Type,
(char *)aa->action->params);
else
fprintf(autosavefile, "104 %i\n", aa->action->Type);
}
}
fprintf(autosavefile, "1000\n");
}
fprintf(autosavefile, "1000\n");
}
{
char **slist;

View File

@ -19,9 +19,6 @@ FixUpBadFocus(int val, void *data)
{
if (win != ewin->client.win)
XSetInputFocus(disp, ewin->client.win, RevertToPointerRoot, CurrentTime);
mode.focuswin = NULL;
mode.realfocuswin = NULL;
mode.context_ewin = NULL;
if (mode.kde_support)
KDE_UpdateFocusedWindow();
}

View File

@ -4126,11 +4126,11 @@ IPC_ForceSave(char *params, Client * c)
c = NULL;
params = NULL;
if (!(master_pid == getpid()))
return;
if (mode.autosave)
/* SaveUserControlConfig(fopen(GetSMFile(), "w")); */
SaveUserControlConfig(fopen(GetGenericSMFile(), "w"));
else
/* rm(GetSMFile()); */
rm(GetGenericSMFile());
return;
}

View File

@ -182,7 +182,6 @@ main(int argc, char **argv)
desks.desk[0].viewable = 0;
/* now we're going to load the configuration/theme */
LoadEConfig(themepath);
/* multihead - let children continue after stop */
{
int i;
@ -278,7 +277,8 @@ main(int argc, char **argv)
mode.startup = 0;
/* SC_Kill(); */
/* ok - paranoia - save current settings to disk */
autosave();
if (root.scr == 0)
autosave();
/* let's make sure we set this up and go to our desk anyways */
ICCCM_GetMainEInfo();
GotoDesktop(desks.current);

View File

@ -71,6 +71,8 @@ EExit(void *code)
if (master_pid == getpid())
{
int i;
exitcode = (int)code;
SoundExit();
if (mustdel)
@ -80,6 +82,8 @@ EExit(void *code)
Esnprintf(sss, sizeof(sss), "/bin/rm -rf %s", themepath);
system(sss);
}
for (i = 0; i < child_count; i++)
kill(e_children[i], SIGCONT);
}
SaveSnapInfo();

View File

@ -390,36 +390,26 @@ autosave(void)
{
if (mode.startup)
return;
if (mode.autosave)
if (master_pid == getpid())
{
char s[4096];
if (mode.autosave)
{
char s[4096];
SaveSnapInfo();
Etmp(s);
SaveUserControlConfig(fopen(s, "w"));
rm(GetGenericSMFile());
mv(s, GetGenericSMFile());
if (!isfile(GetGenericSMFile()))
Alert("There was an error saving your autosave data - filing\n"
"system problems.\n"
);
/*
* if (strcmp(GetSMFile(), GetGenericSMFile()))
* {
* if (exists(GetGenericSMFile()))
* rm(GetGenericSMFile());
* symlink(GetSMFile(), GetGenericSMFile());
* }
*/
}
else
{
/* char buf[1024];
*
* * Esnprintf(buf, sizeof(buf) / sizeof(char), "rm %s*", GetSMFile());
* *
* * system(buf); */
rm(GetGenericSMFile());
SaveSnapInfo();
Etmp(s);
SaveUserControlConfig(fopen(s, "w"));
rm(GetGenericSMFile());
mv(s, GetGenericSMFile());
if (!isfile(GetGenericSMFile()))
Alert("There was an error saving your autosave data - filing\n"
"system problems.\n"
);
}
else
{
rm(GetGenericSMFile());
}
}
}
@ -521,7 +511,7 @@ doSMExit(void *params)
w = MakeExtInitWin();
XCloseDisplay(disp);
disp = NULL;
CommsBroadcastToSlaveWMs("exit quit");
if (themepath[0] != 0)
{
Esnprintf(sss, sizeof(sss),
@ -555,13 +545,17 @@ doSMExit(void *params)
sscanf(params, "%*s %1000s", s);
Esnprintf(sss, sizeof(sss),
"exec %s -ext_init_win %i -theme %s", command, w, s);
CommsBroadcastToSlaveWMs("exit quit");
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", sss, NULL);
}
else
{
sscanf(params, "%*s %1000s", s);
Esnprintf(sss, sizeof(sss),
"restart_theme %s", s);
if (sound_fd >= 0)
close(sound_fd);
CommsSendToMasterWM("restart_theme");
CommsSendToMasterWM(sss);
do_master_kill = 0;
}
}
@ -578,6 +572,7 @@ doSMExit(void *params)
strncpy(s, atword(params, 2), 1000);
real_exec = (char *)Emalloc(strlen(s) + 6);
sprintf(real_exec, "exec %s", s);
CommsBroadcastToSlaveWMs("exit quit");
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", "exec",
real_exec, NULL);
}

View File

@ -200,7 +200,7 @@ SetupX()
master_screen = root.scr;
/* Start up on multiple heads, if appropriate */
if (display_screens > 1 && 0 == single_screen_mode)
if ((display_screens > 1) && (!single_screen_mode))
{
int i;
char subdisplay[255];
@ -220,12 +220,13 @@ SetupX()
if (pid)
{
child_count++;
e_children = Erealloc(e_children, sizeof(pid_t) * child_count);
e_children = Erealloc(e_children, sizeof(pid_t) *
child_count);
e_children[child_count - 1] = pid;
}
else
{
kill(getpid(), SIGSTOP);
pause();
/* Find the point to concatenate the screen onto */
dispstr = strchr(subdisplay, ':');
if (NULL != dispstr)
@ -340,6 +341,7 @@ SetupX()
/* set up a handler for when the X Connection goes down */
XSetIOErrorHandler((XIOErrorHandler) HandleXIOError);
/* slect all the root window events to start managing */
mode.xselect = 1;
XSelectInput(disp, root.win,
ButtonPressMask | ButtonReleaseMask |
EnterWindowMask | LeaveWindowMask | ButtonMotionMask |
@ -560,6 +562,7 @@ SetupX()
mode.group_config.shade = 1;
mode.group_config.mirror = 1;
mode.clickalways = 0;
mode.keybinds_changed = 0;
desks.dragdir = 2;
desks.dragbar_width = 16;

View File

@ -217,6 +217,7 @@ SnapshotEwinDialog(EWin * ewin)
Snapshot *sn;
char s[1024];
fprintf(stderr, "show dialog\n");
if ((d = FindItem("SNAPSHOT_WINDOW", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
{
ShowDialog(d);