From 14ac3391c5d071a67de062f4857280212e12afdb Mon Sep 17 00:00:00 2001 From: oga Date: Thu, 10 Dec 2009 17:16:51 +0000 Subject: finish unfucking the screen_ctx handling. remove screen_current() it was utterly bogus when nscreens > 1. pass a fake client_ctx in the case where there's no client and the kbfunc or mousefunc doesn't need a real one, it just contains the current screen, modify these functions so that they pass down the screen context to their callees. make groups per screen, it's the only way it makes sense in this regard. ok okan@. --- mousefunc.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'mousefunc.c') diff --git a/mousefunc.c b/mousefunc.c index bee700d..828ad83 100644 --- a/mousefunc.c +++ b/mousefunc.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: mousefunc.c,v 1.16 2009/12/08 16:52:17 okan Exp $ + * $Id: mousefunc.c,v 1.17 2009/12/10 17:16:51 oga Exp $ */ #include "headers.h" @@ -198,11 +198,13 @@ mousefunc_menu_group(struct client_ctx *cc, void *arg) void mousefunc_menu_unhide(struct client_ctx *cc, void *arg) { + struct screen_ctx *sc; struct client_ctx *old_cc; struct menu *mi; struct menu_q menuq; char *wname; + sc = cc->sc; old_cc = client_current(); TAILQ_INIT(&menuq); @@ -221,7 +223,7 @@ mousefunc_menu_unhide(struct client_ctx *cc, void *arg) if (TAILQ_EMPTY(&menuq)) return; - mi = menu_filter(&menuq, NULL, NULL, 0, NULL, NULL); + mi = menu_filter(sc, &menuq, NULL, NULL, 0, NULL, NULL); if (mi != NULL) { cc = (struct client_ctx *)mi->ctx; client_unhide(cc); @@ -240,9 +242,12 @@ mousefunc_menu_unhide(struct client_ctx *cc, void *arg) void mousefunc_menu_cmd(struct client_ctx *cc, void *arg) { - struct menu *mi; - struct menu_q menuq; - struct cmd *cmd; + struct screen_ctx *sc; + struct menu *mi; + struct menu_q menuq; + struct cmd *cmd; + + sc = cc->sc; TAILQ_INIT(&menuq); TAILQ_FOREACH(cmd, &Conf.cmdq, entry) { @@ -254,7 +259,7 @@ mousefunc_menu_cmd(struct client_ctx *cc, void *arg) if (TAILQ_EMPTY(&menuq)) return; - mi = menu_filter(&menuq, NULL, NULL, 0, NULL, NULL); + mi = menu_filter(sc, &menuq, NULL, NULL, 0, NULL, NULL); if (mi != NULL) u_spawn(((struct cmd *)mi->ctx)->image); else -- cgit v1.2.3-2-gb3c3