From 4f42f806e15df83b8c5b0362513fca71d7af60f7 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Fri, 3 Feb 2012 18:39:52 +0100 Subject: [PATCH] Add mousebind to p sequence --- src/status.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/status.c b/src/status.c index 544f959..22c92bd 100644 --- a/src/status.c +++ b/src/status.c @@ -215,6 +215,10 @@ status_parse(struct status_ctx *ctx) sq->geo.x = ctx->barwin->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 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); STATUS_ALIGN(sq->align); - draw_rect(ctx->barwin->dr, &sq->geo, sq->color); - - if(!SLIST_EMPTY(&sq->mousebinds)) - SLIST_FOREACH(m, &sq->mousebinds, snext) - m->area = sq->geo; + STORE_MOUSEBIND(); break; @@ -281,6 +281,8 @@ status_apply_list(struct status_ctx *ctx) draw_rect(ctx->barwin->dr, &g, sq->color2); + STORE_MOUSEBIND(); + break; /* Image */ @@ -297,12 +299,8 @@ status_apply_list(struct status_ctx *ctx) sq->geo.y = (ctx->barwin->geo.h >> 1) - (sq->geo.h >> 1); STATUS_ALIGN(sq->align); - draw_image(ctx->barwin->dr, &sq->geo); - - if(!SLIST_EMPTY(&sq->mousebinds)) - SLIST_FOREACH(m, &sq->mousebinds, snext) - m->area = sq->geo; + STORE_MOUSEBIND(); break; #endif /* HAVE_IMLIB2 */