diff options
author | Tiago Cunha <tcunha@gmx.com> | 2010-12-30 22:27:38 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2010-12-30 22:27:38 +0000 |
commit | 095e1b410a31166d1f37e8a6ff99e7bb666737ad (patch) | |
tree | f2885d999020fa54720c720230e0d53dfa27c98b /screen-write.c | |
parent | 210b4553a5d6b1147e8a51d47f6fb748b67e5676 (diff) | |
download | rtmux-095e1b410a31166d1f37e8a6ff99e7bb666737ad.tar.gz rtmux-095e1b410a31166d1f37e8a6ff99e7bb666737ad.tar.bz2 rtmux-095e1b410a31166d1f37e8a6ff99e7bb666737ad.zip |
Sync OpenBSD patchset 812:
Support all four of the xterm mouse modes. Based on a diff from hsim at
gmx.li.
Diffstat (limited to 'screen-write.c')
-rw-r--r-- | screen-write.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/screen-write.c b/screen-write.c index b33c44bb..38596153 100644 --- a/screen-write.c +++ b/screen-write.c @@ -1,4 +1,4 @@ -/* $Id: screen-write.c,v 1.90 2010-06-16 18:09:23 micahcowan Exp $ */ +/* $Id: screen-write.c,v 1.91 2010-12-30 22:27:38 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -829,16 +829,23 @@ screen_write_insertmode(struct screen_write_ctx *ctx, int state) s->mode &= ~MODE_INSERT; } -/* Set mouse mode. */ +/* Set mouse mode off. */ void -screen_write_mousemode(struct screen_write_ctx *ctx, int state) +screen_write_mousemode_off(struct screen_write_ctx *ctx) { struct screen *s = ctx->s; - if (state) - s->mode |= MODE_MOUSE; - else - s->mode &= ~MODE_MOUSE; + s->mode &= ~ALL_MOUSE_MODES; +} + +/* Set mouse mode on. */ +void +screen_write_mousemode_on(struct screen_write_ctx *ctx, int mode) +{ + struct screen *s = ctx->s; + + s->mode &= ~ALL_MOUSE_MODES; + s->mode |= mode; } /* Line feed. */ |