mirror of
https://github.com/tmux/tmux.git
synced 2024-12-25 02:48:47 +00:00
Merge branch 'obsd-master' into master
This commit is contained in:
commit
79f075bf1b
27
popup.c
27
popup.c
@ -441,6 +441,7 @@ popup_key_cb(struct client *c, void *data, struct key_event *event)
|
|||||||
const char *buf;
|
const char *buf;
|
||||||
size_t len;
|
size_t len;
|
||||||
u_int px, py, x;
|
u_int px, py, x;
|
||||||
|
enum { NONE, LEFT, RIGHT, TOP, BOTTOM } border = NONE;
|
||||||
|
|
||||||
if (pd->md != NULL) {
|
if (pd->md != NULL) {
|
||||||
if (menu_key_cb(c, pd->md, event) == 1) {
|
if (menu_key_cb(c, pd->md, event) == 1) {
|
||||||
@ -467,20 +468,22 @@ popup_key_cb(struct client *c, void *data, struct key_event *event)
|
|||||||
goto menu;
|
goto menu;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
if ((~pd->flags & POPUP_NOBORDER) &&
|
if (~pd->flags & POPUP_NOBORDER) {
|
||||||
(~m->b & MOUSE_MASK_META) &&
|
if (m->x == pd->px)
|
||||||
|
border = LEFT;
|
||||||
|
else if (m->x == pd->px + pd->sx - 1)
|
||||||
|
border = RIGHT;
|
||||||
|
else if (m->y == pd->py)
|
||||||
|
border = TOP;
|
||||||
|
else if (m->y == pd->py + pd->sy - 1)
|
||||||
|
border = BOTTOM;
|
||||||
|
}
|
||||||
|
if ((m->b & MOUSE_MASK_MODIFIERS) == 0 &&
|
||||||
MOUSE_BUTTONS(m->b) == 2 &&
|
MOUSE_BUTTONS(m->b) == 2 &&
|
||||||
(m->x == pd->px ||
|
(border == LEFT || border == TOP))
|
||||||
m->x == pd->px + pd->sx - 1 ||
|
|
||||||
m->y == pd->py ||
|
|
||||||
m->y == pd->py + pd->sy - 1))
|
|
||||||
goto menu;
|
goto menu;
|
||||||
if ((m->b & MOUSE_MASK_META) ||
|
if (((m->b & MOUSE_MASK_MODIFIERS) == MOUSE_MASK_META) ||
|
||||||
((~pd->flags & POPUP_NOBORDER) &&
|
border != NONE) {
|
||||||
(m->x == pd->px ||
|
|
||||||
m->x == pd->px + pd->sx - 1 ||
|
|
||||||
m->y == pd->py ||
|
|
||||||
m->y == pd->py + pd->sy - 1))) {
|
|
||||||
if (!MOUSE_DRAG(m->b))
|
if (!MOUSE_DRAG(m->b))
|
||||||
goto out;
|
goto out;
|
||||||
if (MOUSE_BUTTONS(m->lb) == 0)
|
if (MOUSE_BUTTONS(m->lb) == 0)
|
||||||
|
1
tmux.h
1
tmux.h
@ -1159,6 +1159,7 @@ RB_HEAD(sessions, session);
|
|||||||
#define MOUSE_MASK_CTRL 16
|
#define MOUSE_MASK_CTRL 16
|
||||||
#define MOUSE_MASK_DRAG 32
|
#define MOUSE_MASK_DRAG 32
|
||||||
#define MOUSE_MASK_WHEEL 64
|
#define MOUSE_MASK_WHEEL 64
|
||||||
|
#define MOUSE_MASK_MODIFIERS (MOUSE_MASK_SHIFT|MOUSE_MASK_META|MOUSE_MASK_CTRL)
|
||||||
|
|
||||||
/* Mouse wheel states. */
|
/* Mouse wheel states. */
|
||||||
#define MOUSE_WHEEL_UP 0
|
#define MOUSE_WHEEL_UP 0
|
||||||
|
Loading…
Reference in New Issue
Block a user