diff options
author | oga <oga> | 2009-12-10 17:16:51 +0000 |
---|---|---|
committer | oga <oga> | 2009-12-10 17:16:51 +0000 |
commit | 134e777cf095ae292730e1c9d3f7967099878024 (patch) | |
tree | 80a226385db61bf2bdf72e0c0b3490f0930303e9 /mousefunc.c | |
parent | ee7df6a95f80bebc9ec2d8571c1ff8ff2f53cfd0 (diff) | |
download | cwm-134e777cf095ae292730e1c9d3f7967099878024.tar.gz cwm-134e777cf095ae292730e1c9d3f7967099878024.tar.xz cwm-134e777cf095ae292730e1c9d3f7967099878024.zip |
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@.
Diffstat (limited to 'mousefunc.c')
-rw-r--r-- | mousefunc.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/mousefunc.c b/mousefunc.c index c0b3b1a..b66f64c 100644 --- a/mousefunc.c +++ b/mousefunc.c @@ -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 |