Fix segv's, X-errors, memleak, wrapping.

SVN revision: 16258
This commit is contained in:
Kim Woelders 2005-08-21 21:00:55 +00:00
parent 5c756e0076
commit be396df37d
7 changed files with 37 additions and 13 deletions

View File

@ -301,7 +301,7 @@ ShowAlert(char *text)
XGrabServer(dd);
XSync(dd, False);
for (i = 0; i < 600; i += 40)
for (i = 40; i < 600; i += 40)
{
ww = i;
hh = (i * 440) / 600;

View File

@ -875,6 +875,7 @@ BorderWinpartEventMouseUp(EWinBit * wbit, XEvent * ev)
{
EWin *ewin = wbit->ewin;
int part = wbit - ewin->bits;
int left = wbit->left;
GrabPointerRelease();
@ -887,11 +888,12 @@ BorderWinpartEventMouseUp(EWinBit * wbit, XEvent * ev)
#endif
BorderWinpartChange(ewin, part, 0);
if (wbit->win == Mode.events.last_bpress && !wbit->left &&
/* Beware! Actions may destroy the current border */
wbit->left = 0;
if (wbit->win == Mode.events.last_bpress && !left &&
ewin->border->part[part].aclass)
ActionclassEvent(ewin->border->part[part].aclass, ev, ewin);
wbit->left = 0;
}
static void

View File

@ -130,7 +130,7 @@ GetLine(char *s, int size, FILE * f)
if (so == s) /* Skip empty lines */
break;
case_eol:
*so++ = '\0'; /* Terminate and return */
*so = '\0'; /* Terminate and return */
goto done;
case '\r': /* Ignore */
break;
@ -169,6 +169,17 @@ GetLine(char *s, int size, FILE * f)
done:
bufptr = si;
/* Strip trailing whitespace */
si = so;
for (; so > s; so--)
{
ch = so[-1];
if (ch != ' ' && ch != '\t')
break;
}
if (so != si)
*so = '\0';
if (EventDebug(EDBUG_TYPE_CONFIG))
Eprintf("GetLine %s\n", s);

View File

@ -530,8 +530,16 @@ DeskGetBackground(int desk)
void
DeskGetArea(int desk, int *ax, int *ay)
{
*ax = _DeskGet(desk)->current_area_x;
*ay = _DeskGet(desk)->current_area_y;
Desk *d;
d = _DeskGet(desk);
if (!d)
{
*ax = *ay = 0;
return;
}
*ax = d->current_area_x;
*ay = d->current_area_y;
}
void
@ -1654,7 +1662,7 @@ CB_DesktopDisplayRedraw(Dialog * d __UNUSED__, int val, void *data)
ic = ImageclassFind("SETTINGS_DESKTOP_AREA", 0);
if (ic)
ImageclassApply(ic, win, w, h, 0, 0, STATE_NORMAL, 0, ST_UNKNWN);
for (i = 0; i < Conf.desks.num; i++)
for (i = 0; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++)
wins[i] = 0;
called = 1;
}
@ -1667,7 +1675,7 @@ CB_DesktopDisplayRedraw(Dialog * d __UNUSED__, int val, void *data)
Pixmap pmap;
wins[i] = ECreateWindow(win, 0, 0, 64, 48, 0);
XSetWindowBorderWidth(disp, wins[i], 1);
ESetWindowBorderWidth(wins[i], 1);
pmap = ECreatePixmap(wins[i], 64, 48, VRoot.depth);
ESetWindowBackgroundPixmap(wins[i], pmap);
@ -1693,17 +1701,17 @@ CB_DesktopDisplayRedraw(Dialog * d __UNUSED__, int val, void *data)
num = tmp_desktops - 1;
if (num < 1)
num = 1;
ERaiseWindow(wins[i]);
EMoveWindow(wins[i], (i * (w - 64 - 2)) / num,
(i * (h - 48 - 2)) / num);
ERaiseWindow(wins[i]);
EMapWindow(wins[i]);
}
for (i = tmp_desktops; i < Conf.desks.num; i++)
{
if (!wins[i])
continue;
EUnmapWindow(wins[i]);
EDestroyWindow(wins[i]);
wins[i] = None;
}
if (tmp_desktops > 1)

View File

@ -161,7 +161,7 @@ EwinCreate(Window win, int type)
if (!EwinIsInternal(ewin))
{
XShapeSelectInput(disp, win, ShapeNotifyMask);
XSetWindowBorderWidth(disp, win, 0);
ESetWindowBorderWidth(win, 0);
ewin->client.bw = 0;
}

View File

@ -413,6 +413,8 @@ ThemePathFind(void)
Efree(Conf.theme.name);
Conf.theme.name = fullfileof(theme);
if (Mode.theme.path)
Efree(Mode.theme.path);
Mode.theme.path = theme;
}

View File

@ -85,6 +85,7 @@ Bool EQueryPointer(Window win, int *px, int *py, Window * pchild,
#define ESelectInput(win, mask) XSelectInput(disp, win, mask)
#define EGetWindowAttributes(win, attr) XGetWindowAttributes(disp, win, attr)
#define EChangeWindowAttributes(win, mask, attr) XChangeWindowAttributes(disp, win, mask, attr)
#define ESetWindowBorderWidth(win, bw) XSetWindowBorderWidth(disp, win, bw)
#define ERaiseWindow(win) XRaiseWindow(disp, win)
#define ELowerWindow(win) XLowerWindow(disp, win)
#define EClearWindow(win) XClearWindow(disp, win)