aboutsummaryrefslogtreecommitdiffstats
path: root/draw.c
diff options
context:
space:
mode:
authorgotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2>2008-01-17 18:43:40 +0000
committergotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2>2008-01-17 18:43:40 +0000
commitdcaf1806612241f2e73b8e7047233134238fbbac (patch)
treea3c0b66e26d0aea63439d7f4de8127a0dab93611 /draw.c
parent536bffd1aedf24105a4a120f72e2553b6a31592c (diff)
downloaddzen-dcaf1806612241f2e73b8e7047233134238fbbac.tar.gz
dzen-dcaf1806612241f2e73b8e7047233134238fbbac.zip
fixed wrong check in get_rect_vals()
git-svn-id: http://dzen.googlecode.com/svn/trunk@205 f2baff5b-bf2c-0410-a398-912abdc3d8b2
Diffstat (limited to 'draw.c')
-rw-r--r--draw.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/draw.c b/draw.c
index 251d187..e7484b8 100644
--- a/draw.c
+++ b/draw.c
@@ -225,19 +225,20 @@ get_rect_vals(char *s, int *w, int *h, int *x, int *y) {
buf[i] = '\0';
*w = atoi(buf);
+
for(j=0, ++i; s[i] && s[i] != '+' && s[i] != '-' && i<ARGLEN; j++, i++)
buf[j] = s[i];
buf[j] = '\0';
*h = atoi(buf);
if(s[i]) {
- for(j=0, ++i; s[i] && s[i] != '+' && s[i] != '-' && i<ARGLEN; j++, i++)
+ for(j=0, ++i; s[i] && s[i] != '+' && s[i] != '-' && j<ARGLEN; j++, i++) {
buf[j] = s[i];
- if(j<2) {
- buf[j] = '\0';
- *x = atoi(buf);
- *y = atoi(s+i);
}
+ buf[j] = '\0';
+ *x = atoi(buf);
+ if(s[i])
+ *y = atoi(s+i);
}
}
@@ -302,7 +303,7 @@ parse_line(const char *line, int lnr, int align, int reverse, int nodraw) {
/* positioning */
int n_posx, n_posy, set_posy=0;
int px=0, py=0, xorig;
- int i, next_pos=0, j=0, h=0, tw, ow;
+ int i, next_pos=0, j=0, h=0, tw=0, ow;
/* fonts */
int font_was_set=0;
@@ -325,7 +326,7 @@ parse_line(const char *line, int lnr, int align, int reverse, int nodraw) {
XpmColorSymbol xpms;
#endif
- /* sensitive areas */
+ /* sensitive areas
Window sa_win=0;
Drawable sapm=0;
int opx=0;
@@ -333,6 +334,7 @@ parse_line(const char *line, int lnr, int align, int reverse, int nodraw) {
sawa.background_pixmap = ParentRelative;
sawa.event_mask = ExposureMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | KeyPressMask;
+ */
/* parse line and return the text without control commands */
if(nodraw) {
@@ -359,8 +361,8 @@ parse_line(const char *line, int lnr, int align, int reverse, int nodraw) {
opm = XCreatePixmap(dzen.dpy, RootWindow(dzen.dpy, DefaultScreen(dzen.dpy)), dzen.title_win.width,
dzen.line_height, DefaultDepth(dzen.dpy, dzen.screen));
}
- sapm = XCreatePixmap(dzen.dpy, RootWindow(dzen.dpy, DefaultScreen(dzen.dpy)), dzen.slave_win.width,
- dzen.line_height, DefaultDepth(dzen.dpy, dzen.screen));
+ //sapm = XCreatePixmap(dzen.dpy, RootWindow(dzen.dpy, DefaultScreen(dzen.dpy)), dzen.slave_win.width,
+ // dzen.line_height, DefaultDepth(dzen.dpy, dzen.screen));
pm = &opm;
if(!reverse) {
@@ -451,8 +453,10 @@ parse_line(const char *line, int lnr, int align, int reverse, int nodraw) {
recty = recty == 0 ? (dzen.line_height - recth)/2 : recty;
px = rectx == 0 ? px : rectx+px;
setcolor(pm, px, rectw, lastfg, lastbg, reverse, nobg);
- XFillRectangle(dzen.dpy, *pm, dzen.tgc, (int)px,
- set_posy ? py : ((int)recty<0 ? dzen.line_height + recty : recty), rectw, recth);
+ XFillRectangle(dzen.dpy, *pm, dzen.tgc, px,
+ set_posy ? py :
+ ((int)recty < 0 ? dzen.line_height + recty : recty),
+ rectw, recth);
px += rectw;
break;
@@ -643,7 +647,7 @@ parse_line(const char *line, int lnr, int align, int reverse, int nodraw) {
recty = (recty == 0) ? (dzen.line_height - recth)/2 : recty;
px = (rectx == 0) ? px : rectx+px;
setcolor(pm, px, rectw, lastfg, lastbg, reverse, nobg);
- XFillRectangle(dzen.dpy, *pm, dzen.tgc, (int)px,
+ XFillRectangle(dzen.dpy, *pm, dzen.tgc, px,
set_posy ? py : ((int)recty<0 ? dzen.line_height + recty : recty), rectw, recth);
px += rectw;