Draw: Add bool arg to parse_image_block to don't save mouse bind at textw call

This commit is contained in:
Martin Duquesnoy 2011-08-01 23:38:03 +02:00
parent 39080f9952
commit 570a3f0e64
2 changed files with 6 additions and 5 deletions

View File

@ -77,10 +77,11 @@ draw_image(Drawable dr, int x, int y, int w, int h, char *name)
* --> \i[x;y;w;h;name]\
*\param im ImageAttr pointer, image properties
*\param str String
*\param m Check dynamic mouse
*\return n Lenght of i
*/
static void
parse_image_block(Drawable dr, char *str)
parse_image_block(Drawable dr, char *str, bool m)
{
ImageAttr im;
BarWindow *bw;
@ -98,7 +99,7 @@ parse_image_block(Drawable dr, char *str)
draw_image(dr, im.x - sw, im.y, im.w, im.h, im.name);
/* Etablish clickable area on image (on infobar wins only (status mouse bind) */
if(n == 7)
if(n == 7 && m)
{
area.x = im.x - sw;
area.y = im.y;
@ -150,7 +151,7 @@ draw_text(Drawable d, int x, int y, char* fg, char *str)
ostr = xstrdup(str);
textlen = strlen(ostr);
parse_image_block(d, str);
parse_image_block(d, str, True);
}
#endif /* HAVE_IMLIB */
@ -252,7 +253,7 @@ textw(char *text)
{
ostr = xstrdup(text);
textlen = strlen(ostr);
parse_image_block(d, text);
parse_image_block(d, text, False);
}
#endif /* HAVE_IMLIB */

View File

@ -49,7 +49,7 @@ statustext_mouse(char *str, Geo area, InfoBar *infobar)
char cmd[256] = { 0 };
char func[64] = { 0 };
for(; i < strlen(str); ++i)
for(; i < strlen(str); ++i, sm = NULL)
if((n = sscanf(&str[i], "(%d;%64[^;];%256[^)])", &button, func, cmd) >= 2) && n < 4)
{
sm = zcalloc(sizeof(StatusMouse));