Add mousebind to p sequence

This commit is contained in:
Martin Duquesnoy 2012-02-03 18:39:52 +01:00
parent cf701a43b6
commit 4f42f806e1

View File

@ -215,6 +215,10 @@ status_parse(struct status_ctx *ctx)
sq->geo.x = ctx->barwin->geo.w - right - sq->geo.w; \ sq->geo.x = ctx->barwin->geo.w - right - sq->geo.w; \
right += sq->geo.w; \ right += sq->geo.w; \
} }
#define STORE_MOUSEBIND() \
if(!SLIST_EMPTY(&sq->mousebinds)) \
SLIST_FOREACH(m, &sq->mousebinds, snext) \
m->area = sq->geo;
static void static void
status_apply_list(struct status_ctx *ctx) status_apply_list(struct status_ctx *ctx)
{ {
@ -254,12 +258,8 @@ status_apply_list(struct status_ctx *ctx)
sq->geo.y = (ctx->barwin->geo.h >> 1) - (sq->geo.h >> 1); sq->geo.y = (ctx->barwin->geo.h >> 1) - (sq->geo.h >> 1);
STATUS_ALIGN(sq->align); STATUS_ALIGN(sq->align);
draw_rect(ctx->barwin->dr, &sq->geo, sq->color); draw_rect(ctx->barwin->dr, &sq->geo, sq->color);
STORE_MOUSEBIND();
if(!SLIST_EMPTY(&sq->mousebinds))
SLIST_FOREACH(m, &sq->mousebinds, snext)
m->area = sq->geo;
break; break;
@ -281,6 +281,8 @@ status_apply_list(struct status_ctx *ctx)
draw_rect(ctx->barwin->dr, &g, sq->color2); draw_rect(ctx->barwin->dr, &g, sq->color2);
STORE_MOUSEBIND();
break; break;
/* Image */ /* Image */
@ -297,12 +299,8 @@ status_apply_list(struct status_ctx *ctx)
sq->geo.y = (ctx->barwin->geo.h >> 1) - (sq->geo.h >> 1); sq->geo.y = (ctx->barwin->geo.h >> 1) - (sq->geo.h >> 1);
STATUS_ALIGN(sq->align); STATUS_ALIGN(sq->align);
draw_image(ctx->barwin->dr, &sq->geo); draw_image(ctx->barwin->dr, &sq->geo);
STORE_MOUSEBIND();
if(!SLIST_EMPTY(&sq->mousebinds))
SLIST_FOREACH(m, &sq->mousebinds, snext)
m->area = sq->geo;
break; break;
#endif /* HAVE_IMLIB2 */ #endif /* HAVE_IMLIB2 */