From dd10412804923a5e1b2aab46ab94c4f8e29696fb Mon Sep 17 00:00:00 2001 From: okan Date: Tue, 9 Jul 2013 01:24:49 +0000 Subject: since the root and event window are the same in the case of a button event on the screen's root window, there's no need to pass down the entire XButtonEvent event, at least to group_menu(), the only callback which takes an argument at this point; instead use the already populated screen. --- calmwm.h | 2 +- group.c | 5 +---- mousefunc.c | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/calmwm.h b/calmwm.h index 9a5517d..820cf32 100644 --- a/calmwm.h +++ b/calmwm.h @@ -360,7 +360,7 @@ void group_autogroup(struct client_ctx *); void group_cycle(struct screen_ctx *, int); void group_hidetoggle(struct screen_ctx *, int); void group_init(struct screen_ctx *); -void group_menu(XButtonEvent *); +void group_menu(struct screen_ctx *); void group_movetogroup(struct client_ctx *, int); void group_only(struct screen_ctx *, int); void group_sticky(struct client_ctx *); diff --git a/group.c b/group.c index a25972a..020faf6 100644 --- a/group.c +++ b/group.c @@ -309,16 +309,13 @@ group_cycle(struct screen_ctx *sc, int flags) } void -group_menu(XButtonEvent *e) +group_menu(struct screen_ctx *sc) { - struct screen_ctx *sc; struct group_ctx *gc; struct menu *mi; struct menu_q menuq; int i; - sc = screen_fromroot(e->root); - TAILQ_INIT(&menuq); for (i = 0; i < CALMWM_NGROUPS; i++) { diff --git a/mousefunc.c b/mousefunc.c index 40fae3f..faf9b65 100644 --- a/mousefunc.c +++ b/mousefunc.c @@ -216,7 +216,7 @@ mousefunc_client_rcyclegroup(struct client_ctx *cc, void *arg) void mousefunc_menu_group(struct client_ctx *cc, void *arg) { - group_menu(arg); + group_menu(cc->sc); } void -- cgit 1.4.1