aboutsummaryrefslogtreecommitdiffstats
path: root/mousefunc.c
diff options
context:
space:
mode:
authoroga2009-12-10 17:16:51 +0000
committeroga2009-12-10 17:16:51 +0000
commit14ac3391c5d071a67de062f4857280212e12afdb (patch)
tree7b3c4be635704fcb02ad2444a881fe93e02b595f /mousefunc.c
parent4c4c8d61c662cfe45e4aa6b6662a1c00947225db (diff)
downloadcwm-14ac3391c5d071a67de062f4857280212e12afdb.tar.gz
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.c17
1 files changed, 11 insertions, 6 deletions
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