Fri Nov 19 18:58:56 PST 1999

(Raster)

fix variable expansion for file execcing...
fix mensu to be onscreen including submenus when u have menus onsreen selected.


SVN revision: 1342
This commit is contained in:
Carsten Haitzler 1999-11-20 00:11:32 +00:00
parent d05244742f
commit f8ffe4d157
4 changed files with 79 additions and 4 deletions

View File

@ -3980,3 +3980,11 @@ that is uniconified when the iconbox is closed.
In any case, there were strange things going on with
mode.focuswin, because FocusToEWin(NULL) returns immediately
in clickmode ... hope the whole thing is history now.
-------------------------------------------------------------------------------
Fri Nov 19 18:58:56 PST 1999
(Raster)
fix variable expansion for file execcing...
fix mensu to be onscreen including submenus when u have menus onsreen selected.

View File

@ -761,12 +761,42 @@ int
execApplication(void *params)
{
char exe[FILEPATH_LEN_MAX];
char s[FILEPATH_LEN_MAX], *ss;
int i, l;
FILE *f;
EDBUG(6, "execApplication");
if (!params)
EDBUG_RETURN(0);
sscanf((char *)params, "%4000s", exe);
runApp(exe, (char *)params);
ss = params;
l = strlen(ss);
exe[0] = 0;
strcat(exe, "echo \"");
for (i = 0; i < l; i++)
{
if (ss[i] == '"')
strcat(exe, "\\\"");
else
{
char ch[2];
ch[0] = ss[i];
ch[1] = 0;
strcat(exe, ch);
}
}
strcat(exe, "\"");
f = popen(exe, "r");
if (f)
{
fread(s, 1, FILEPATH_LEN_MAX, f);
s[FILEPATH_LEN_MAX - 1] = 0;
l = strlen(s);
s[l - 1] = 0;
sscanf(s, "%4000s", exe);
pclose(f);
runApp(exe, s);
}
EDBUG_RETURN(0);
}

View File

@ -2517,7 +2517,7 @@ SubmenuShowTimeout(int val, void *dat)
{
int mx, my;
unsigned int mw, mh;
EWin *ewin2;
EWin *ewin2, *ewin;
struct _mdata *data;
data = (struct _mdata *)dat;
@ -2542,6 +2542,43 @@ SubmenuShowTimeout(int val, void *dat)
UnShadeEwin(ewin2);
if (mode.cur_menu[mode.cur_menu_depth - 1] != data->mi->child)
mode.cur_menu[mode.cur_menu_depth++] = data->mi->child;
if (mode.menusonscreen)
{
EWin *menus[256];
int fx[256];
int fy[256];
int tx[256];
int ty[256];
int i;
int xdist = 0, ydist = 0;
if (ewin2->x + ewin2->w > root.w)
xdist = root.w - (ewin2->x + ewin2->w);
if (ewin2->y + ewin2->h > root.h)
ydist = root.h - (ewin2->y + ewin2->h);
if ((xdist != 0) || (ydist != 0))
{
for (i = 0; i < mode.cur_menu_depth; i++)
{
menus[i] = NULL;
if (mode.cur_menu[i])
{
ewin = FindEwinByMenu(mode.cur_menu[i]);
if (ewin)
{
menus[i] = ewin;
fx[i] = ewin->x;
fy[i] = ewin->y;
tx[i] = ewin->x + xdist;
ty[i] = ewin->y + ydist;
}
}
}
SlideEwinsTo(menus, fx, fy, tx, ty,
mode.cur_menu_depth, mode.shadespeed);
XWarpPointer(disp, None, None, 0, 0, 0, 0, xdist, ydist);
}
}
}
val = 0;
}

View File

@ -924,8 +924,8 @@ pathtoexec(char *file)
if (canexec(s))
EDBUG_RETURN(s);
Efree(s);
EDBUG_RETURN(NULL);
#endif
EDBUG_RETURN(NULL);
}
p = getenv("PATH");
if (!p)