-/* $OpenBSD: server-client.c,v 1.257 2018/08/19 20:13:07 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.258 2018/08/22 20:06:14 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
key_code key;
struct timeval tv;
enum { NOTYPE, MOVE, DOWN, UP, DRAG, WHEEL, DOUBLE, TRIPLE } type;
- enum { NOWHERE, PANE, STATUS, BORDER } where;
+ enum { NOWHERE, PANE, STATUS, STATUS_LEFT, STATUS_RIGHT, BORDER } where;
type = NOTYPE;
where = NOWHERE;
if (type == NOTYPE)
return (KEYC_UNKNOWN);
- /* Always save the session. */
+ /* Save the session. */
m->s = s->id;
+ m->w = -1;
/* Is this on the status line? */
m->statusat = status_at_line(c);
if (m->statusat != -1 && y == (u_int)m->statusat) {
- w = status_get_window_at(c, x);
- if (w == NULL)
- return (KEYC_UNKNOWN);
- m->w = w->id;
- where = STATUS;
- } else
- m->w = -1;
+ if (x < c->status.left_size)
+ where = STATUS_LEFT;
+ else if (x > c->tty.sx - c->status.right_size)
+ where = STATUS_RIGHT;
+ else {
+ w = status_get_window_at(c, x);
+ if (w == NULL)
+ return (KEYC_UNKNOWN);
+ m->w = w->id;
+ where = STATUS;
+ }
+ }
/* Not on status line. Adjust position and check for border or pane. */
if (where == NOWHERE) {
key = KEYC_MOUSEDRAGEND1_PANE;
if (where == STATUS)
key = KEYC_MOUSEDRAGEND1_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDRAGEND1_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDRAGEND1_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_MOUSEDRAGEND1_BORDER;
break;
key = KEYC_MOUSEDRAGEND2_PANE;
if (where == STATUS)
key = KEYC_MOUSEDRAGEND2_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDRAGEND2_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDRAGEND2_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_MOUSEDRAGEND2_BORDER;
break;
key = KEYC_MOUSEDRAGEND3_PANE;
if (where == STATUS)
key = KEYC_MOUSEDRAGEND3_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDRAGEND3_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDRAGEND3_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_MOUSEDRAGEND3_BORDER;
break;
key = KEYC_MOUSEDRAG1_PANE;
if (where == STATUS)
key = KEYC_MOUSEDRAG1_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDRAG1_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDRAG1_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_MOUSEDRAG1_BORDER;
break;
key = KEYC_MOUSEDRAG2_PANE;
if (where == STATUS)
key = KEYC_MOUSEDRAG2_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDRAG2_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDRAG2_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_MOUSEDRAG2_BORDER;
break;
key = KEYC_MOUSEDRAG3_PANE;
if (where == STATUS)
key = KEYC_MOUSEDRAG3_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDRAG3_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDRAG3_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_MOUSEDRAG3_BORDER;
break;
key = KEYC_WHEELUP_PANE;
if (where == STATUS)
key = KEYC_WHEELUP_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_WHEELUP_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_WHEELUP_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_WHEELUP_BORDER;
} else {
key = KEYC_MOUSEUP1_PANE;
if (where == STATUS)
key = KEYC_MOUSEUP1_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEUP1_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEUP1_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_MOUSEUP1_BORDER;
break;
key = KEYC_MOUSEUP2_PANE;
if (where == STATUS)
key = KEYC_MOUSEUP2_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEUP2_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEUP2_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_MOUSEUP2_BORDER;
break;
key = KEYC_MOUSEUP3_PANE;
if (where == STATUS)
key = KEYC_MOUSEUP3_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEUP3_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEUP3_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_MOUSEUP3_BORDER;
break;
key = KEYC_MOUSEDOWN1_PANE;
if (where == STATUS)
key = KEYC_MOUSEDOWN1_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDOWN1_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDOWN1_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_MOUSEDOWN1_BORDER;
break;
key = KEYC_MOUSEDOWN2_PANE;
if (where == STATUS)
key = KEYC_MOUSEDOWN2_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDOWN2_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDOWN2_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_MOUSEDOWN2_BORDER;
break;
key = KEYC_MOUSEDOWN3_PANE;
if (where == STATUS)
key = KEYC_MOUSEDOWN3_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_MOUSEDOWN3_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_MOUSEDOWN3_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_MOUSEDOWN3_BORDER;
break;
key = KEYC_DOUBLECLICK1_PANE;
if (where == STATUS)
key = KEYC_DOUBLECLICK1_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_DOUBLECLICK1_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_DOUBLECLICK1_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_DOUBLECLICK1_BORDER;
break;
key = KEYC_DOUBLECLICK2_PANE;
if (where == STATUS)
key = KEYC_DOUBLECLICK2_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_DOUBLECLICK2_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_DOUBLECLICK2_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_DOUBLECLICK2_BORDER;
break;
key = KEYC_DOUBLECLICK3_PANE;
if (where == STATUS)
key = KEYC_DOUBLECLICK3_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_DOUBLECLICK3_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_DOUBLECLICK3_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_DOUBLECLICK3_BORDER;
break;
key = KEYC_TRIPLECLICK1_PANE;
if (where == STATUS)
key = KEYC_TRIPLECLICK1_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_TRIPLECLICK1_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_TRIPLECLICK1_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_TRIPLECLICK1_BORDER;
break;
key = KEYC_TRIPLECLICK2_PANE;
if (where == STATUS)
key = KEYC_TRIPLECLICK2_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_TRIPLECLICK2_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_TRIPLECLICK2_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_TRIPLECLICK2_BORDER;
break;
key = KEYC_TRIPLECLICK3_PANE;
if (where == STATUS)
key = KEYC_TRIPLECLICK3_STATUS;
+ if (where == STATUS_LEFT)
+ key = KEYC_TRIPLECLICK3_STATUS_LEFT;
+ if (where == STATUS_RIGHT)
+ key = KEYC_TRIPLECLICK3_STATUS_RIGHT;
if (where == BORDER)
key = KEYC_TRIPLECLICK3_BORDER;
break;
-/* $OpenBSD: tmux.h,v 1.842 2018/08/20 20:41:58 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.843 2018/08/22 20:06:14 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
#define KEYC_CLICK_TIMEOUT 300
/* Mouse key codes. */
-#define KEYC_MOUSE_KEY(name) \
- KEYC_ ## name ## _PANE, \
- KEYC_ ## name ## _STATUS, \
+#define KEYC_MOUSE_KEY(name) \
+ KEYC_ ## name ## _PANE, \
+ KEYC_ ## name ## _STATUS, \
+ KEYC_ ## name ## _STATUS_LEFT, \
+ KEYC_ ## name ## _STATUS_RIGHT, \
KEYC_ ## name ## _BORDER
-#define KEYC_MOUSE_STRING(name, s) \
- { #s "Pane", KEYC_ ## name ## _PANE }, \
- { #s "Status", KEYC_ ## name ## _STATUS }, \
+#define KEYC_MOUSE_STRING(name, s) \
+ { #s "Pane", KEYC_ ## name ## _PANE }, \
+ { #s "Status", KEYC_ ## name ## _STATUS }, \
+ { #s "StatusLeft", KEYC_ ## name ## _STATUS_LEFT }, \
+ { #s "StatusRight", KEYC_ ## name ## _STATUS_RIGHT }, \
{ #s "Border", KEYC_ ## name ## _BORDER }
/*
struct screen *old_status;
int window_list_offset;
+
+ u_int left_size;
+ u_int right_size;
};
/* Client connection. */